This patch adds a way break up long bits of text with a "See More..." link that hides the text
below it until the link is clicked. The hidden text then scrolls into view. A subsequent click re-hides it. All the text is still on the page so Google, etc can find it.
You can use this on Fragments or Products (or anywhere you have long lumps of text).
INSTALLATION
This is for sites with jQuery already loaded. If you've got any of my add-ons, you probably already have this. If you're using SellerDeck 2014 or later, then jQuery is loaded by default.
Go to Design / Library / Layouts / JavaScript Header Functions / Standard JavaScript Header Functions.
Scroll down to the bottom and after everything append the following:
OK out and that's the tweak installed.
OPERATION
In your Fragments / Product Descriptions where you want some "See More..." type stuff to start put:
Then all the text that you want to keep hidden.
End that text with:
Example:
NOTES
You can also use this on other tag types and you can customise the See More... and Hide... bits
on a per-link basis as follows:
You can use this multiple times on a page and even multiple times within the same description.
below it until the link is clicked. The hidden text then scrolls into view. A subsequent click re-hides it. All the text is still on the page so Google, etc can find it.
You can use this on Fragments or Products (or anywhere you have long lumps of text).
INSTALLATION
This is for sites with jQuery already loaded. If you've got any of my add-ons, you probably already have this. If you're using SellerDeck 2014 or later, then jQuery is loaded by default.
Go to Design / Library / Layouts / JavaScript Header Functions / Standard JavaScript Header Functions.
Scroll down to the bottom and after everything append the following:
Code:
<!-- SeeMore support --> <script type="text/javascript"> function seemore(anc){ $(anc).text( $(anc).next( ".seemore" ).is( ":visible" ) ? $(anc).attr('data-text') : $(anc).attr('data-hide')); $(anc).next( ".seemore" ).toggle(500); return false; } $(document).ready(function(){ $( ".seemore" ).each(function(){ var linktext = $(this).attr('data-link') ? $(this).attr('data-link') : 'See More...'; var hidetext = $(this).attr('data-hide') ? $(this).attr('data-hide') : 'Hide...'; $(this).hide().before('<a href="#" onclick="return seemore(this)" data-text="' + linktext + '" data-hide="' + hidetext + '" class="seemorelink">' + linktext + '</a>'); }); }); </script>
OPERATION
In your Fragments / Product Descriptions where you want some "See More..." type stuff to start put:
Code:
!!<<span class="seemore">>!!
End that text with:
Code:
!!<</span>>!!
Code:
Text that will be shown all the time. Text that will be shown all the time. Text that will be shown all the time. Text that will be shown all the time. !!<<span class="seemore">>!! Text that will be hidden. Text that will be hidden. Text that will be hidden. Text that will be hidden. Text that will be hidden. !!<</span>>!!
You can also use this on other tag types and you can customise the See More... and Hide... bits
on a per-link basis as follows:
Code:
!!<<div class="seemore" data-link="Expand..." data-hide="Dismiss">>!! . . . !!<</div>>!!
Comment