Jump to content

auto show current li link


argyrism

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.