Показать сообщение отдельно
  #3 (permalink)  
Старый 27.07.2015, 12:58
Аспирант
Отправить личное сообщение для stem Посмотреть профиль Найти все сообщения от stem
 
Регистрация: 09.03.2013
Сообщений: 36

Попробовал, не работает, у меня несколько элементов на странице + есть элемент с другими параметрами для меню (разворачивается в бок). В JS не силен, нашел код и чуток допилил его под свои нужны на сколько хватило знаний, поэтому для нескольких элементов продублировал код. Когда удалил $(window).load(function(){ }); везде и оставил только один, то так же все перестало работать.

Вот полный код:
<script type="text/javascript">
	$(window).load(function(){
	$(document).ready(function(){
    $('#menu-ico').on('click',function(){
        if($(this).data('click')==0){
            $('#menu-ico').css('position','absolute');
             $('#fixmenu').css('width','100%');
             $(this).data('click','1');
        }
        else{
            $('#fixmenu').css('width','50px');
            $('#menu-ico').css('position','relative');

             $(this).data('click','0');
        }
        
    });
	});
	});
	$(window).load(function(){
	$(document).ready(function(){
	$('#block-price-1').on('click',function(){
        if($(this).data('click')==0){
             $('#block-price-1 .hide-block').css('max-height','0');
             $(this).data('click','1');
        }
        else{
            $('#block-price-1 .hide-block').css('max-height','1000px');

             $(this).data('click','0');
        }
        
    });
	});
	});
	$(window).load(function(){
	$(document).ready(function(){
	$('#block-price-2').on('click',function(){
        if($(this).data('click')==0){
             $('#block-price-2 .hide-block').css('max-height','0');
             $(this).data('click','1');
        }
        else{
            $('#block-price-2 .hide-block').css('max-height','1000px');

             $(this).data('click','0');
        }
        
    });
	});
	});
	$(window).load(function(){
	$(document).ready(function(){
	$('#block-price-3').on('click',function(){
        if($(this).data('click')==0){
             $('#block-price-3 .hide-block').css('max-height','0');
             $(this).data('click','1');
        }
        else{
            $('#block-price-3 .hide-block').css('max-height','1000px');

             $(this).data('click','0');
        }
        
    });
	});
	});
	$(window).load(function(){
	$(document).ready(function(){
	$('#block-price-4').on('click',function(){
        if($(this).data('click')==0){
             $('#block-price-4 .hide-block').css('max-height','0');
             $(this).data('click','1');
        }
        else{
            $('#block-price-4 .hide-block').css('max-height','700px');

             $(this).data('click','0');
        }
        
    });
	});
	});
	</script>
Ответить с цитированием