understanding how the basic animations functions in jQuery helps. $("#something").show() jQuery uses amendments to the element syle attribute to make this happen. So in your example $("#this=thing&that=more&bing=bang").show() will override the display:none If as you say you are doing this dynamically it's important to understand that if an element is not in existence when document.ready functions fire it has no events tied to it http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F Old Orange Juice wrote: OK, been banging my head with this for a while. I have a dynamic site where we get a list of elements from the database, we identify these items with id numbers and encoded get strings. So I'm trying to get style changes to take affect with jquery and it really just doesn't work.I'm not sure what I'm doing wrong. Here is the source code: <html> <head> <script type=text/_javascript_ src="" script> <script> $(document).ready(function() { $("#this=thing&that=more&bing=bang_anchor").click(function() { //event.preventDefault; $("#this=thing&that=more&bing=bang").attr('style','display: block'); }); }); </script> </head> <body> <a href="" id='this=thing&that=more&bing=bang_anchor'>Display</a> <div id="this=thing&that=more&bing=bang" style="display: none"> Lorem Ipsum dolor sit amnet. </div> </body> </html> This code is supposed to make the div appear when link is clicked.. Can anyone point out what I'm doing wrong? |
- [jQuery] changing style attributes. Old Orange Juice
- [jQuery] Re: changing style attributes. Charlie
- [jQuery] Re: changing style attributes. Old Orange Juice