
23.07.2009, 14:19
|
|
Участник форума
Регистрация: 11.10.2006
Сообщений: 134
Провел на форуме: 3607644
Репутация:
235
|
|
2 Feras
Немного коряво написал, времени мало было. Для работы тебе еще понадобится jquery.cookie.js .
PHP код:
<html>
<head>
<script src="./js/jquery.js"></script>
<script src="./js/jquery.cookie.js"></script>
<script>
$(function(){
//Если нажата кнопка open и есть кука
if ($.cookie('submitOpen-' + 1)) {
$('#close').show("slow");
$('#open').css("display","none");
}
$('#open').click(function() {
cookieSet(1);
$('#open').slideUp();
$('#close').show("slow");
});
$('#close').click(function() {
cookieDel(1);
$('#close').slideUp();
$('#open').show("slow");
});
});
function cookieSet(index) {
$.cookie('submitOpen-' + index, 'open', {expires: null, path: '/'});
}
function cookieDel(index) {
$.cookie('submitOpen-' + index, null, {expires: null, path: '/'});
}
</script>
</head>
<body>
<div>
<input type="submit" name="open" id="open" value="open" />
</div>
<div>
<input type="submit" name="close" id="close" value="close" style="display:none"/>
</div>
</body>
</html>
|
|
|