views:

86

answers:

3

how to hide a bullet points? example like this website

http://www.grainge.org/pages/various_rh_projects/alt_dropdowns/showhide_3/showhide3.htm

you can see the example

first Hotspot

second hotspot

if we click 'first' it appears but if not it's not appear. how to do that

+1  A: 

This is done in JavaScript, not python, I would wager. Basic strategy:

  • Start by adding (in the HTML) class="hideme" to the div's or p's or li's you want to affect.
  • Then using something like the below hideClass(class) function (jQuery would be worth looking at too), select all parts of the page with class="hideme" and set their style to display: none to hide or display: block to show

.

function hideClass(name)
{
    var matches = getElementsByClassName(name);
    for (var i = 0; i < matches.length; i++)
    {
        var match = matches[i];
        match.style.display = "none";
    }
}

This calls getElementsByClassName.js available here:

http://code.google.com/p/getelementsbyclassname/

A function showClass(name) could be made similarly, with match.style.display = "block";

Jared Updike
+1  A: 

This is certainly done with javascript.

Another possibility is to have empty elements

<div id="myelt"></div>

and to change the html content of this element

document.getElementById('myelt').innerHTML = "My text";

luc
A: 

In jQuery you could do it like this (v. quick example):

$(function(){
    $('ul ul')
        .hide() //Hide the sub-lists
        .siblings('a').click(function(){
            $(this).siblings('ul').toggle(); //show or hide the hidden ul
        });
});

This should also allow for sub-lists with hidden children and hotspots.

Chris