When you scroll down, I want the floating input's src to be 2.png but currently it is staying as 1.png. If you look closely, you can see that the original input's src is changed to 2. The 开发者_开发技巧opposite of what I want.
I cant be sure but I think that the problem it that the script is making a copy of the original header to display the floating header - therefore there are 2 inputs with the same id, I know thats bad but I was unable to get the selectors working based using class.
Here is what I have so far:
http://joe-riggs.com/test/prototype.html
the code that is not working is at lines 134 & 146
Thanks
Multiple ids are bad because that is invalid html. JavaScript will not select both elements, some browsers will not select either.
Not sure what is hard to select element by class, in prototype it is:
var imgs = $$(".test");
Setting the src with each
$$(".test").each( function(img){ img.src="2.png" } );
精彩评论