Loading...
JavaScript | Мастера JS (jquery)
Вообще есть два кода, немного разных, но они выполняют одно и то же действие... Нужно выбрать один, который будет отображать действие корректно на всех типах брауезерах..Да я не силен в js по этому задаю вопрос...

Первый:

$(document).ready(function(){
var i=0,heightContainer=$(".b-container").height();
$('.foo').click(function(){
if(i==1){$(".content-right").animate({marginLeft:"-=272px"},{duration:450,specialEasing:{marginLeft:'swing'}},$(".b-container").height(heightContainer));i=0;}
else{
$(".content-right").animate({marginLeft:"+=272px"},{duration:450,specialEasing:{marginLeft:'swing'}},showLeftFullSize());i=1;}

return false;});});

showLeftFullSize=function(){var contentLeft=$(".slide-menu"),contentRight=$(".b-container");
if(contentRight.height()<contentLeft.height()){contentRight.height(contentLeft.height());}};


Второй:

$(document).ready(function(){var i=0,heightContainer=$(".b-container").height();
$('.foo').click(function(){if(i==1){

$(".content-right").animate({marginLeft:"-=272px"},{
duration:450,specialEasing:{marginLeft:'swing'}},
$(".b-container").height(heightContainer));i=0;}
else{$(".content-right").animate({marginLeft:"+=272px"},{
duration:450,specialEasing:{marginLeft:'swing'}},showLeftFullSize());i=1;}
return false;});});

showLeftFullSize=function(){var contentLeft=$(".slide-menu"),contentRight=$(".b-container");
if(contentRight.height()<contentLeft.height()){contentRight.height(contentLeft.height());}};
Онлайн: 6
Время:
Gen. 0.0636
(c) ByMAS.RU 2010-2025