SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: script tree

  1. #1
    SitePoint Zealot
    Join Date
    Jan 2010
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    script tree

    I have sample script that open tree

    I want still open in next page or until choose another one

    any help

    +computerbooks
    Asp.Net
    HTML
    PHP
    +Langaugebooks
    English
    Arabic

    the problem i want selected link

    Code:
    <script>
    		$(document).ready(function() {
    $('li.type').addClass('plusshow');
    $('li.type').children().addClass('selected');
    $('li.type').children().hide();
    $('li.type').each(
    function(column) {
    $(this).click(function(event){
    if (this == event.target) {
    if($(this).is('.plusshow')) {
    $(this).children().show();
    $(this).removeClass('plusshow');
    $(this).addClass('minusshow');
    }
    else
    {
    $(this).children().hide();
    $(this).removeClass('minusshow');
    $(this).addClass('plusshow');
    }
    }
    });
    }
    );
    });</script>
    <style>
    	
    	.plusshow{
     list-style-image:url(../img/expand-large-blue-Shapes4FREE.png);
     cursor:pointer;
     margin-right:5em;
     }
    .minusshow{
     list-style-image:url(../img/collapse-large-blue-Shapes4FREE.png);
     cursor:pointer;
      margin-right:5em;
    
     }
    &nbsp;
    .selected{
     list-style-image:url(../img/selected.png);
     cursor:pointer;
     }
    	</style>
    PHP Code:
    <ul><li class="type"><? echo '<br />.$type.''.'books'.<br />';?>
        
        
        <?$row_count 1
        while(
    $rowv=mysql_fetch_array($resultv)){
        
    ?><ul>            
                <li><a href="types.php?id=<?php echo $rowv[bookid];?><? echo $rowv[bookid]; ?></a></li>


     
                </ul><?}?></li></ul>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,707
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by altarek View Post
    I have sample script that open tree

    I want still open in next page or until choose another one
    If you are navigating to a new page, you will need that new page to know about which part of the tree to keep open. That can be dine by either using cookies, or by using a fragment URL, from which that information can be obtained.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •