- This topic is empty.
April 6, 2013 at 2:02 am #43918
hi guys, have some problem here. i’ve been trying to fade in content using jQuery, but everytime i clicked the link on the left, the page view went wrong.
Let say when i click “CSS” link on the left, the content faded in but the header is pushed away.
This is the [example](http://cdpn.io/kBvFt “example” )
I want to create something like the [SNIPPETS](https://css-tricks.com/snippets/ “sinppets”) page. Where the page view is static when we click the menu on the left.
Another more simple methods are welcome. Thanks in advanced. :)April 6, 2013 at 4:09 am #130800pixelgridParticipant
what makes your page jump on link click is the href of #and id which has a special meaning in browsers . takes the page to the point where that id is found.your content changes and the id is found right next to the navigation making the header disappear from view.
this code does what you want
var to_show = $(this).attr(‘id’)+’Play’;
1 click doesnt do anything
2 hides the into text ass well as every other open article
3 shows the text related to the linkApril 6, 2013 at 7:14 am #130823
Thank you for helping me pixelgrid! Your code works. But i have another problem if i add another link in the page. Let say i add links (Home, About, Contact, Forum) in the header. The links are dead if i click it. How am i gonna resolve this matter? thanks again in advanced.April 6, 2013 at 7:28 am #130824pixelgridParticipant
give the ul in the sidebar a special class like this(class given is content)
ul class = ‘content’>
- Java Script
var toShow = $(this).attr(‘id’)+’Play’;
});April 6, 2013 at 8:01 am #130828
ok i get it. Thanks again pixelgrid! you are very helpfull