Jquery current menu
Posted
by Isis
on Stack Overflow
See other posts from Stack Overflow
or by Isis
Published on 2010-05-28T10:35:51Z
Indexed on
2010/05/28
11:02 UTC
Read the original article
Hit count: 232
Hello I have:
var href = window.location.href;
if(href.search('/welcome\\/') > 0)
{
$('.menuwelcome').css('display', 'block');
$('#welcome2').append('<b>?????????? ??????????</b>').find('a').remove();
$('#welcome2').find('img').attr('src', '/static/images/arrow_black.gif');
}
if(href.search('/contacts\\/') > 0)
{
$('.menuwelcome').css('display', 'block');
$('#mcontacts').append('<b>????????</b>').find('a').remove();
$('#mcontacts').find('img').attr('src', '/static/images/arrow_black_down.gif');
}
if(href.search('/sindbad_history\\/') > 0)
{
$('.menuwelcome').css('display', 'block');
$('.menuwelcome:first').append('<b>???????</b>').find('a').remove();
$('.menuwelcome:first').find('img').attr('src', '/static/images/arrow_black.gif');
}
if(href.search('/insurance\\/') > 0)
{
$('.menusafe').css('display', 'block');
$('#msafe').append('<b>???????????</b>').find('a').remove();
$('#msafe').find('img').attr('src', '/static/images/arrow_black_down.gif');
}
if(href.search('/insurance_advices\\/') > 0)
{
$('.menusafe').css('display', 'block');
$('.menusafe:first').append('<b>???????? ??????????</b>').find('a').remove();
$('.menusafe:first').find('img').attr('src', '/static/images/arrow_black.gif');
}
How can I minimize this code? Sorry for bad english
© Stack Overflow or respective owner