html - Changing img src attribute on iPad using jQuery -


i have script changing img src, runs great on every browser except safari on ipad. here is:

$("#carousel a").click(function() {   var itemid = $(this).attr("itemid");   $("#collection-photo img").attr("src", "path_"+itemid); }); 

and here html code:

<div id="collection-photo">   <img src="path_0" alt=""/> </div> <ul id="carousel">   <li><a href="#" itemid="1"><img src="some_img_1" alt=""/></a></li>   <li><a href="#" itemid="2"><img src="some_img_2" alt=""/></a></li>   <li><a href="#" itemid="3"><img src="some_img_3" alt=""/></a></li>   ... </ul> 

all pathes right, cause works in every browser, said earlier. use jquery 1.9.1.

thank you.

sorry question, guys. problem bad russian cms , solved it, help.

try - thing stop link executing, when comes images. clicking # reload browsers unless return false/preventdefault

$("#carousel a").click(function(e) {   e.preventdefault(); // cancel click   var itemid = $(this).attr("itemid");   $("#collection-photo img").attr("src", "path_"+itemid); }); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -