SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    436
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    exchange it with jquery

    Code:
      <div id="orderprice">
        <a href="http://localhost/job/index.php?main_page=index&cPath=<?php echo $_GET['cPath'];?>&sort=3a">Price Up</a> 
        <a href="http://localhost/job/index.php?main_page=index&cPath=<?php echo $_GET['cPath'];?>&sort=3d">Price Down</a></div>
    <div id="ordername">
    <a href="http://localhost/job/index.php?main_page=index&cPath=<?php echo $_GET['cPath'];?>&sort=2a">Name Up </a> 
    <a href="http://localhost/job/index.php?main_page=index&cPath=<?php echo $_GET['cPath'];?>&sort=2d">Name Down </a></div>
    when the user click Price Up the Price Down show, Price Up text hide. vice versa。

    ps: why this can't work?
    Code:
    $("#orderprice a,#ordername a").eq(1).hide();

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure if this is what you're trying to do? Show the link for Price Up by default, then if Price Up is clicked that link should be hidden and Price Down shows?

    If so, you could do this:
    First, put an id on the Price Up and Price Down anchor tags - id="priceUp" & id="priceDown", respectively.

    Code:
    /* First, hide the Price Down link by default */
    $("#priceDown").hide();
    
    /* Hide Price Up on click and show Price Down */
    $("#priceUp").click(function(){
      $(this).hide();
      $("#priceDown").show();
    });
    
    /* Hide Price Down link on click and show Price Up */
    $("#priceDown").click(function(){
      $(this).hide();
      $("#priceUp").show();
    });


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
  •