Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Javascript Menu

    UPDATE: Always seems to work right after I post...

    BUT, with it doesn't work graphically unless I comment out jquery, but then the links do not work...

    Is there a way I could just pull the loadContent function from jquery, any idea what it is?

    Cheers.

    ________________

    I am just running through a few CSS Javascript menu tutorials, this one I am having a bit of trouble with in a certain part of the test site:
    http://www.phatfusion.net/imagemenu/

    The menu as you can see is an image menu, and the links run via this javascript:

    Code:
    <script type="text/javascript">
    
    window.addEvent('domready', function(){
         var myMenu = new ImageMenu($$('#imageMenu a'),{
              openWidth:310, 
              border:2,
              <!-- The code below controls the link click -->
              onOpen:function(e,i){
                   alert(e);
              }
         });
    });
    
    </script>

    Bascially, the code I need to implement for a content switch is:

    Code:
    function loadContent (id) {
         $("#contentArea").load("php/rpc.php?o=" + id + "");
    }
    Works fine with links that aren't encased in the image-menu div or ul:

    <a href="javascript:loadContent(1)">link</a>

    It just doesn't work with the photo-menu.

    Some things that I have tried and didn't work are:

    1.
    Code:
    <a href="javascript:loadContent(1)">link</a>
    in the hope it would just work...

    2.
    Code:
    <a href="1">link</a>
    Code:
    <script type="text/javascript">
    
    window.addEvent('domready', function(){
         var myMenu = new ImageMenu($$('#imageMenu a'),{
              openWidth:310, 
              border:2,
              <!-- The code below controls the link click -->
              onOpen:function(e){
                        $("#contentArea").load("php/rpc.php?o=" + e + "");
              }
         });
    });
    
    </script>
    I have included jquery.js also just in case that is what the loadContent is from. The php file is fine, I've tested a copy remotely. I am quite stuck, any ideas anyone? I know it is doable, has to be, just cannot figure it out for the life of me.

    Thanks in advance,
    Matt.
    Last edited by gringos; 09-04-2008 at 07:16 AM.


 

Posting Permissions

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