OK, been banging my head with this for a while. I have a dynamic sitewhere we get a list of elements from the database, we identify theseitems with id numbers and encoded get strings. So I'm trying to getstyle changes to take affect with jquery and it really just doesn'twork.I'm not sure what I'm doing wrong. Here is the source code:
I am attempting to change the style after the user has loaded the page(every x number of seconds) but the element just doesn't seem to berefreshing. I have done all of the checking, and it seems like it ischanging it but it isn't showing that on the page.
How to change style on a series of divs (with similar structure but different content) *only if* all the children are visible (that's using visibility, not display). Sample div: <div class="h"> <p class="a1">text</p> <p class="b2">more text></p> <p class="b3">text text</p> <p class="a4">text...</p> <p class="link_display_none_visibility_visible">div name</p></div> I think it needs to use contents(), but not sure about handling node numbers.
Is there a way to pervent it from runing onload the second time?
My understanding had been that $.css("width") would return the original user selected style, eg "100%" or "10em", and $.width() returned the computed width, always in "px". Not so, following the code through for .css(), it calls something called getComputedStyle and the only difference between the two functions turns out to be a post-fix of "px" on the .css() result - not very useful. I need to know whether my user has called me with a proportional dimension, or a fixed one. How to tell with jQuery?
This is probably quite a simple problem but I can't figure out the answer. I'm working on a site that has news stories and events coming in. What I would like is to have the news stories to be styled with squares and events with discs for instance. I might be able to change the actual plug-in so the CSS affects this change, but I just wondered how I could change the list-style-type with jQuery.
I am trying to dynamically clear the value of a form input field and then submit the form.When I used $('#my_field').val('') to clear the field, it was cleared on the screen but when the form was submitted the original value of the input field was posted.My browser is FireFox and I can see using FireBug that when the field is cleared, firebug is still showing the html code with the old value. E.G. <input type="text" value="old_value" />The same situation occurred if I used $('#my_field').attr('value', '') to clear the field.The same situation occurred if I actually changed the value of the field rather than just clearing it.To work around this problem I ended up using the $('#my_field').removeAttr('value') to clear the field before it was submitted.
The pages are based on tables, so the parts that change are all cells.
1. Can I define text instead of an image in the array? i.e. can I have the image change to say an apple in one cell and the next cell have text explaining what an apple is?
2. Would it be possible to put a countdown timer for when the image/text is going to change?
Ive got a small image of a power button and when pressed the inner section on the button changes to yellow, but when its pressed down Im also trying to get part of my H1 (main header logo title) to change to yellow.
Ive created a span with an id surrounding the letters of the H1 that I want to change, the id being : "power";
<img id="poweron" src="http://www.sitepoint.com/forums/images/power.png" alt="Power on button" onmousedown="this.src='images/poweron.png';" onmouseup="this.src='images/power.png';"/>
I understand Im not really supposed to be using inline JS, and I know Ive got to create a function for the onmousedown event to trigger changing the H1 text, so am I under the right impression that the JS so far written is redundant and will have to be re-written so thats contained within a script placed just before the closing </body> and an external script for invoking the main function ?