bmanferlife
New Member
This is a little hard to explain but I'll try my best. I have a bunch of links\[code\]<li><a class="various fade " href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/NIKE_SNOW.html"> <img src="http://stackoverflow.com/questions/14085494/MAIN_IMAGES/ZOOM_FORCE_2.jpg" border="0"/></a></li> <li><a class="various1 fade " href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/MERCURIAL_SUPERFLY.html"><img src="http://stackoverflow.com/questions/14085494/MAIN_IMAGES/MERCURIAL_SUPERFLY-2.jpg" border="0" /></a></li><li><a class="various2 fade " href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/AIRMAX_MOTO.html"><img src="http://stackoverflow.com/questions/14085494/MAIN_IMAGES/AIRMX-2.jpg" border="0" /></a></li><li><a class="various3 fade " href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/le-coq-joakim-noah.html"><img src="http://stackoverflow.com/questions/14085494/MAIN_IMAGES/JOAKIM-NOAH-3.jpg" border="0" /></a></li> <li><a class="various4 fade " href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/NIKE_BMX.html"><img src="http://stackoverflow.com/questions/14085494/MAIN_IMAGES/GYZIRO-3.jpg" border="0" /></a></li>\[/code\]and another set of links\[code\]<a class="ex1 various" href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/NIKE_SNOW.html">ZOOM FORCE ONE ///</a> <a class="ex1 various1" href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/MERCURIAL_SUPERFLY.html">MERCURIAL SUPERFLY ///</a> <a class="ex1 various2" href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/AIRMAX_MOTO.html">AIRMX MOTO BOOT ///</a> <a class="ex1 various3" href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/le-coq-joakim-noah.html">JOAKIM NOAH ///</a> <a class="ex1 various4" href="http://stackoverflow.com/questions/14085494/FOOTWEAR_SUB_PAGES/NIKE_BMX.html">DUNK GYRIZO</a>\[/code\]now when someone clicks any of these links this js is called. \[code\]$(document).ready(function () {$("ul#gallery li a").each(function (i, item) { var url = $(item).attr("href"); var links = $("a.ex1.various"); var link = $(links.parent().find("a[href='" + url + "']")); var redclass = "showing-in-gallery"; var gallery = $("#gallery"); var scroll = function () { link.addClass(redclass); gallery.animate({ left: -1 * $(item).position().left }, 1500); gallery.css("width", gallery.width() + 640 + "px"); $(item).parent().after('<li id="gallery_spacer" style="width: 640px;"></li>'); imageIndex = $(".ex1").index($(this)); imageIndex = $(".fade").index($(this)); setGalleryLinks(); }; $(this).bind("click", scroll); link.bind("click", scroll);});\[/code\]How can I check to see if .ex1 or .fade were clicked?such as \[code\] if (ex1 clicked){ imageIndex = $(".ex1").index($(this));} if (fade clicked){ imageIndex = $(".fade").index($(this));}\[/code\]any help would be a life saver I've been spending days on this.