Jump to content

Recommended Posts

hi,

i have the following javascript code:

 

function initMenu() {
$('#menu ul').hide();
<?php 
if($catid!="") {
$current_id='#a'.$_GET['catid']; //the li's - links have an id of the form a123 where 123 is the category's id
?>
//what code to put here and show the current_link;

<?php
} else {
?>
$('#menu ul:first').show(); 
<?php
}
?>

$('#menu li a').click(
function() {
var checkElement = $(this).next();
if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#menu ul:visible').slideUp('normal');
checkElement.slideDown('normal');
return false;
}
}
);
}
$(document).ready(function() {


initMenu();



});

what i want to do is to show the current link without having to click on the ul link, you can see it online at the right menu at : www.tigicy.com/products.php

Link to comment
https://forums.phpfreaks.com/topic/204253-auto-show-current-li-link/
Share on other sites

i have a php code to get the passing parameter (catid) and i echo to javascript that parameter . I now started learning javascript and css , i only program in php  and mysql . what i want to do is to make the menu to slide where the passing catid is the same as the links catid using javascript.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.