Cool that works. Thanks! New to this and trying to get multiple sliders on one page but cant figure out how the script will make multiple slider variables based on this example.
Changing the code so the page has multiple sliders. <div id="slide_<?php echo rand(); ?>" class="slides">slider here </div> <div id="slide_<?php echo rand(); ?>" class="slides">slider here </div> <div id="slide_<?php echo rand(); ?>" class="slides">slider here </div> <div id="slide_<?php echo rand(); ?>" class="slides">slider here </div> <script type="text/javascript" charset="utf-8"> window.onload = function () { var container = $('div.sliderGallery'); var ul = $('ul', container); var itemsWidth = ul.innerWidth() - container.outerWidth(); $('.slider', container).slider({ min: 0, max: itemsWidth, handle: '.handle', stop: function (event, ui) { ul.animate({'left' : ui.value * -1}, 500); }, slide: function (event, ui) { ul.css('left', ui.value * -1); } }); }; </script> ________________________________ From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: May-28-09 3:36 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Get ID <script type="text/javascript"> $(function() { $('div[id^="menu_"]').each(function() { alert(this.id); }); }); </script> On Thu, May 28, 2009 at 10:56 AM, Dave Maharaj :: WidePixels.com <d...@widepixels.com> wrote: There are going to be multiple .test on the page.... how can i alert(myID) for all the elements on the page.... just testing it so i can see its gtting them all? Thanks Dave ________________________________ From: waseem sabjee [mailto:waseemsab...@gmail.com] Sent: May-28-09 2:55 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Get ID var myID = $(".test").attr("id"); alert(myID); On Thu, May 28, 2009 at 6:24 AM, Dave Maharaj :: WidePixels.com <d...@widepixels.com> wrote: How do you find an ID that is generated dynamically? <div id="menu_<?php echo $variable ;?>" class="test"> Dave -- I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.