Activity Stream
48,167 MEMBERS
6860 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 2 of 2
  1.     
    #1
    Member

    Default Help About JavaScript

    Hello all,

    I need help about java script. For example: i have some text and users must click "see hidden" to show that.
    I need script called by div, becouse that will only work im my case
    macypro Reviewed by macypro on . Help About JavaScript Hello all, I need help about java script. For example: i have some text and users must click "see hidden" to show that. I need script called by div, becouse that will only work im my case :) Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    TRy this:

    <script language="javascript">
    <!--

    var state = 'none';

    function showhide(layer_ref) {

    if (state == 'block') {
    state = 'none';
    }
    else {
    state = 'block';
    }
    if (document.all) { //IS IE 4 or 5 (or 6 beta)
    eval( "document.all." + layer_ref + ".style.display = state");
    }
    if (document.layers) { //IS NETSCAPE 4 or below
    document.layers[layer_ref].display = state;
    }
    if (document.getElementById &&!document.all) {
    hza = document.getElementById(layer_ref);
    hza.style.display = state;
    }
    }
    //-->
    </script>
    and this html code for each division that is to be hidden/shown:
    <p><a href="#" onclick="showhide('div1');">Show/hide me</a></p>
    <div id="div1" style="display: none;">This is the content</div>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [WordPress] How to do this in javascript/php?
    By thizzladen in forum Web Application/Script Support
    Replies: 0
    Last Post: 16th Mar 2012, 12:05 AM
  2. Need Javascript Help
    By Netguy in forum Web Development Area
    Replies: 7
    Last Post: 19th Mar 2011, 03:24 PM
  3. JavaScript Kit
    By Daniel in forum Useful Sites
    Replies: 0
    Last Post: 7th Mar 2011, 06:48 PM
  4. javascript help
    By jokerhacker in forum Web Development Area
    Replies: 4
    Last Post: 27th Dec 2010, 11:02 AM
  5. help with some javascript
    By bumilad20 in forum Web Application/Script Support
    Replies: 2
    Last Post: 3rd Jun 2010, 05:01 AM

Tags for this Thread

BE SOCIAL