...

View Full Version : quikie: where to find script



frik
04-28-2006, 04:34 PM
hi, just a quick one! i'm after a simple script that 'toggles' show/hide more info on a page as can be seen here (http://search.reviews.ebay.co.uk/Help-Us-Spread-The-Message_EAN_0780661001720_W0QQfvcsZ1277QQsoprZ3959070) (click the link "more information").

i've searched the readymadeJava (http://www.javascriptkit.com/cutpastejava.shtml) page and have had no luck, but i'm pretty sure i've seen it here a while back, if i'm not mistaken? cant seem to find it anymore

A1ien51
04-28-2006, 05:26 PM
Basic idea:



function toggleDisplayInfo(id){
document.getElementById(id).style.display = (document.getElementById(id).style.display == "block")?"none":"block";
}




<a href="#" onclick="toggleDisplayInfo('someid');return false;">Show/Hide</a>
<div id="someid" style="display:none;">asdf</div>


fyi: untested and typed here,
Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum