So i'm trying to write my first bit of jQuery to do something on a site and I'm sure I could probably copy some code to do it but I want to do it myself, I've been watching lots of jQuery tutorials (just watching the first one on here that Chris did) and basically I can't seem to get my coding working correctly.
That's exactly how it is in my header section on the site. Basically trying to get it to change the 'top' of the media-bar, here is the HTML:
<div id="media-bar"> <div id="media-bar-content"> This is the media bar<br> This is another line.<br> This is yet another line of text. </div> </div> <div id="start-here-holder"> <div id="start-here"> <a href="#">Start here</a> </div> </div>
It's basically hidden from the page. If I change the #media-bar 'top' to 0px it displays where I want it to once you have clicked the 'start here' div. If you get what I mean. I can't see why it shouldn't be working?
someone will be able to make it much better than this, and also the start-here div positions itself ready for the media-bar, not sure if you want that... anyway good luck
Thanks fourize, the code you supplied worked fine, I used to it add a top value to the start-here DIV to move that down 200px.
Though the only way I could get it working properly was to use the mouseover the header and page-wrap so put it back away, but that's ok for now, I'm gonna watch some more tutorials/read up on jQuery as I need to be able to do this kinda stuff properly, but for now my code will work ok, this is what the jQuery ended up being like:
So i'm trying to write my first bit of jQuery to do something on a site and I'm sure I could probably copy some code to do it but I want to do it myself, I've been watching lots of jQuery tutorials (just watching the first one on here that Chris did) and basically I can't seem to get my coding working correctly.
Here is the code I've written:
That's exactly how it is in my header section on the site. Basically trying to get it to change the 'top' of the media-bar, here is the HTML:
The CSS for the media bar is as follows:
It's basically hidden from the page. If I change the #media-bar 'top' to 0px it displays where I want it to once you have clicked the 'start here' div. If you get what I mean. I can't see why it shouldn't be working?
Thanks a lot if anyone can help!
Ash
change your html to this
your jquery to something like this...
and your css, just so the div appears clickable
someone will be able to make it much better than this, and also the start-here div positions itself ready for the media-bar, not sure if you want that... anyway good luck
Though the only way I could get it working properly was to use the mouseover the header and page-wrap so put it back away, but that's ok for now, I'm gonna watch some more tutorials/read up on jQuery as I need to be able to do this kinda stuff properly, but for now my code will work ok, this is what the jQuery ended up being like:
So for now that will have to suffice :)