2

We are using Quicksand ( the sortable filterbale quicksand plugin )

Anyhoo..

Apart from the normal filters, to initiate the quicksand animation. We also can display the individual < li > 's by using a sweet little Layout Switcher.

The code of which is:

<!-- layout switcher -->
    <div id="layoutSwitcher">
        <a id="buttonsend" class="notsosmall pink button">More Info</a>
    </div>
    <!-- /end layout switcher -->

But my issue is If active I want to display Less Info.

In normal state to show More Info.

I am positive we can do this using jQuery

The jQuery to control the switcher is:

jQuery('#layoutSwitcher a').myPortfolioLayoutSwitcher({
    show_switcher: true,
    full_width_layout: false 
});

So my question is simply.. can we change button text onclick to display less info or more info as necessary.

my

2 Answers 2

5

Easy Peasy. You just need to toggle between two text spans.

 <a id="buttonsend" class="notsosmall pink button">
     <span>More Info</span>
     <span style="display:none">Less Info</span>
 </a>

and some JS

$('a#buttonsend').click(function() {
    $('span',this).toggle();
});

See it working here: http://jsfiddle.net/m9zxx/

Sign up to request clarification or add additional context in comments.

2 Comments

Perfect thanks :) have changed first $ to jQuery , thats correct isnt it ?
Yep, $ and jQuery are interchangeable. If you are using another library in addition to library its best to use jQuery rather than $
2

Assuming that plugin works like jquery's inherent toggle method, toggle should work.

jQuery('#layoutSwitcher a').myPortfolioLayoutSwitcher({
    show_switcher: true,
    full_width_layout: false 
}).toggle(
    function(){jQuery(this).html('show less');},
    function(){jQuery(this).html('show more');});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.