[jQuery] Re: New to Jquery : Using it on dynmaically created divs

2008-10-24 Thread James2008
Hi again, Jonathan - I have tried that function in replace of my own and it doesn't seem to work :-s Any ideas? Thanks, James On Oct 23, 9:30 pm, ricardobeat [EMAIL PROTECTED] wrote: A more resilient solution is to use class names instead, you can't just drop/ignore the IDs altogether: div

[jQuery] Re: New to Jquery : Using it on dynmaically created divs

2008-10-24 Thread James2008
I've now got the divs sliding with this very simple code : function divShowHide(divID, imgID){ // Hides/Shows the vehicle details div and changes arrow appearance var divToChange = document.getElementById(divID); var arrowToChange = document.getElementById(imgID);

[jQuery] Re: New to Jquery : Using it on dynmaically created divs

2008-10-24 Thread ricardobeat
Using IDs with the solution I proposed above should work: function divShowHide(divID, imgID){ var $divToShow = $('#'+divID); var arrowURL = $divToShow.is(':visible') ? 'downarrow.gif'' : 'uparrow.gif''; // the above is the same as: if ($divToShow.is(':visible')) { arrow = 'downarrow.gif

[jQuery] Re: New to Jquery : Using it on dynmaically created divs

2008-10-23 Thread Jonathan Sharp, Out West Media
Hi James, Here's one way to rewrite it using jQuery: function divShowHide(divID, imgID) { var d = $('#' + divID).toggle(); $('#' + imageID).attr('src', 'Images/' + ( d.is(':visible') ? 'down' : 'up' ) + 'arrow.png' ); } Cheers, -Jonathan On Oct 23, 2008, at 8:42 AM, James2008

[jQuery] Re: New to Jquery : Using it on dynmaically created divs

2008-10-23 Thread ricardobeat
A more resilient solution is to use class names instead, you can't just drop/ignore the IDs altogether: div class=titleProduct 8234/div (with background-image: url(downarrow.gif) on CSS) div class=descriptionbla bla bla bla/div $('div.title').click(function(){ var arrow = (