简体   繁体   中英

how to prevent conflict beetween two jquery plugin

I have two jquery plugin Image Picker link and select2 link when i use the both of this plugin one of them is cannot run here is my code

jquery code

$(".select2").select2();
$(".imagepicker").imagepicker();

select menu for select2

<select class="select2">
<option value="1">One</option>
<option value="2">Two</option>
</select>

select menu for imagepicker

<select class="imagepicker">
  <option data-img-src="img/01.png" value="1">  Page 1  </option>
  <option data-img-src="img/02.png" value="2">  Page 2  </option>
  <option data-img-src="img/03.png" value="3">  Page 3  </option>
</select>

I don't know what is happening, but when I use the both of this plugin one of them is not working, maybe because in same select tag?

I am sorry my english is bad

经验法则是,您上次加载的插件将超过上一个段。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM