Помощник
|
JQuery |
errload
|
Сообщение
#1
|
||
|
|
||
|
|||
LeeSwagger |
15.6.2012, 18:40;
Ответить: LeeSwagger
Сообщение
#2
|
|
Не пойму что за браузер?
Я потестил, всё норм! Вот код страницы: <html xmlns="http://www.w3.org/1999/xhtml" lang="ru">
<head> <title>template - width 1024 center</title> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1251"> <style> #about { width: 100%; height: 100px; background: #000080; display: none; } #contact { width: 100%; height: 100px; background: #BB0000; display: block; } </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script> function aboutLink() { $('#contact').fadeOut(500); $('#about').delay(800).fadeIn(500); } </script> </head> <body> <div id="about" >123</div> <div id="contact">567</div> <a href="javascript:void(0)" onclick='aboutLink()'>Click me</a> </body> </html> |
|
|
cyber_ua |
15.6.2012, 19:02;
Ответить: cyber_ua
Сообщение
#3
|
|
Не пойму что за браузер? Я потестил, всё норм! Вот код страницы: <html xmlns="http://www.w3.org/1999/xhtml" lang="ru"> <head> <title>template - width 1024 center</title> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1251"> <style> #about { width: 100%; height: 100px; background: #000080; display: none; } #contact { width: 100%; height: 100px; background: #BB0000; display: block; } </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script> function aboutLink() { $('#contact').fadeOut(500); $('#about').delay(800).fadeIn(500); } </script> </head> <body> <div id="about" >123</div> <div id="contact">567</div> <a href="javascript:void(0)" onclick='aboutLink()'>Click me</a> </body> </html> во первых этот вообще работать не будет. поправить так нужно <a href="Javascript<b></b>:void(0)" onclick='aboutLink();return false;'>Click me</a> во вторых он срабатывает только один раз. и втретьих браузер ставит события в очередь и как только выполняется предыдущие , вызывается следущие в очереди |
|
|
cyber_ua |
15.6.2012, 19:07;
Ответить: cyber_ua
Сообщение
#4
|
|
если вам не нужно чтобы onclick выполнялся пока анимация в процессе то :
нужно его сбрасывать на время выполнения функции , а потом снова устанавливать! |
|
|
errload
|
Сообщение
#5
|
|
Не пойму что за браузер? Проверял в IE, Chrome и Opera, везде одинаково работает..... Ок, вот полный код: <html>
<head> <title>site</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> </head> <body> <a href="javascript:aboutLink();" id="aboutMenu">about</a> | <a href="javascript:contactLink();" id="contactMenu">contact</a> | <a href="javascript:createMenu();" id="createMenu">create</a> <style> #create { width: 100%; height: 100px; display: none; border: 1px solid black; } #about { width: 100%; height: 100px; display: none; border: 1px solid black; } #contact { width: 100%; height: 390px; display: none; border: 1px solid black; } </style> <script> function aboutLink() { if(document.getElementById("create")) { $('#create').fadeOut(200); $('#about').delay(200).fadeIn(200); } if(document.getElementById("contact")) { $('#contact').fadeOut(200); $('#about').delay(200).fadeIn(200); } } function contactLink() { if(document.getElementById("about")) { $('#about').fadeOut(200); $('#contact').delay(200).fadeIn(200); } if(document.getElementById("create")) { $('#create').fadeOut(200); $('#contact').delay(200).fadeIn(200); } } function createMenu() { if(document.getElementById("about")) { $('#about').fadeOut(200); $('#create').delay(200).fadeIn(200); } if(document.getElementById("contact")) { $('#contact').fadeOut(200); $('#create').delay(200).fadeIn(200); } } </script> <div id="create"> create </div> <div id="about"> about </div> <div id="contact"> contact </div> </body> </html> |
|
|
cyber_ua |
15.6.2012, 19:16;
Ответить: cyber_ua
Сообщение
#6
|
|
|
|
|
errload
|
Сообщение
#7
|
|
|
|
|
cyber_ua |
15.6.2012, 19:20;
Ответить: cyber_ua
Сообщение
#8
|
|
|
|
|
Muxa_hb |
15.6.2012, 19:21;
Ответить: Muxa_hb
Сообщение
#9
|
|
|
|
|
errload
|
Сообщение
#10
|
|
Ну вы прикололись с моего скрипта? Если несколько раз щелкнуть по одной и той же ссылке когда стоит другой блок, новый появляется снизу пока старый еще не ушел.. А потом поднимается наверх... Как это убрать? 2 дня уже мучаюсь...
|
|
|
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Услуги по созданию и доработке скриптов PHP, MySQL, JavaScript, jQuery Разработка сайтов и сервисов под-ключ |
0 | alexey | 1239 | 24.11.2023, 14:46 автор: alexey |
|
Веб-разработка (HTML5, CSS3, JavaScript, jQuery, Ajax, PHP) | 56 | qpPeW | 44896 | 19.7.2023, 10:03 автор: qpPeW |
|
1C-Bitrix, JavaScript\jQuery, Верстка HTML5 CSS3 | 1 | byteeightlab | 1470 | 2.7.2019, 7:37 автор: ychervov |
|
Недорогие услуги - php/js/mysql/jquery/bootstrap | 2 | vlads | 3820 | 25.12.2017, 21:18 автор: xetedata |
|
Frontend услуги (верстка, подключение jquery плагинов, кастомизация, написание скриптов) услуги по frontend-разработке |
15 | FrontMaster | 10050 | 25.11.2017, 13:46 автор: Stom |
Текстовая версия | Сейчас: 18.4.2024, 15:30 |