Log In · Register

 
How am I able to do thissss?
Jamesisgsnap
post Apr 25 2010, 09:56 AM
Post #1


Senior Member
****

Group: Member
Posts: 164
Joined: May 2008
Member No: 647,219



Okay, So I realized I have a lot of content on my website.
So I asked a suggestion, and They told me to have it hidden, and pretty much people click on it to Bring the rest up, instead of going to a new page to get it all, it can just appear, and disappear by View more, or Hide the rest, etc.

http://ego-box.com/ - Their Content bar, the View more, How do you do that?
 
 
Start new topic
Replies
fixtatik
post Apr 26 2010, 05:24 PM
Post #2


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



If you want to go the jQuery route, might I make a bit of a suggestion on Mike's code.

Instead of using IDs (as you'll probably not want to make a new bit of jQuery for each new section you want to hide), try it with classes. Something like this could do the trick nicely:
CODE
jQuery(function(){
    jQuery('a.show').click(function(){
        jQuery('a.show').not(jQuery(this)).next('div').hide('normal');
        jQuery(this).next('div').toggle('normal');
        return false
    }).next('div').hide()
})

CODE
<a class="toggle" href="#">Toggle</a>
<div>Anything in here will be toggled on clicking the preceding link</div>

<a class="toggle" href="#">Toggle</a>
<div>Anything in here will be toggled on clicking the preceding link</div>

<a class="toggle" href="#">Toggle</a>
<div>Anything in here will be toggled on clicking the preceding link</div>


It works like an accordion, so if you have a section open and click on a different toggle link, the already open section will be hidden as the current one is shown.
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: