Цитата:
|
$(document).ready(function(){
var hash = window.location.hash;
switch(hash){
case '#video' : Change('1')
break
case '#music' : Change('2')
break
case '#games' : Change('3')
break
case '#converse' : Change('4')
break
case '#portal' : Change('5')
break
case '#servises' : Change('6')
break
case '#books' : Change('7')
break
case '#vkchat' : Change('8')
break
}
});
|
Можно проще:
$(function(){
var a = window.location.hash, b = ['video', 'music', 'games', 'converse', 'portal', 'servises', 'books', 'vkchat'];
for(i=0; i<b.length; i++) if(a == '#'+b[i]) Change(i+1);
});