Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Web программирование > JavaScript, Ajax
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 10.07.2009, 11:45   #1
zorro77786
Новичок
Джуниор
 
Регистрация: 10.07.2009
Сообщений: 2
По умолчанию Реализация не стандартного меню joomla1.5

Не получается, чтобы при щелчке по определенной картинке пункта меню joomla она заменялась на другую, причем для каждого пункта разную и оставалось такой же до щелчка по другому пункту. Может в скрипте дело.
Вот то что имею.


Код:
sfHover = function() {
var sfEls = document.getElementById("ja-cssmenu").getElementsByTagName("li");
for (var i=0; i<sfEls.length; ++i) {
sfEls.onmouseover=function() {
clearTimeout(this.timer);
if(this.className.indexOf("sfhover") == -1)
this.className+="sfhover";
}
sfEls.onmouseout=function() {
this.timer = setTimeout(sfHoverOut.bind(this), 20);
}
}
}
 
function sfHoverOut() {
clearTimeout(this.timer);
this.className=this.className.replace(new RegExp("sfhover\\b"), "");
}
 
if (window.attachEvent) window.attachEvent("onload", sfHover);
CSS



Код:
#ja-cssmenu li a {
display: block;
text-decoration: none;
font-size: 80%;
color: #395467;
padding: 60px 20px;
font-weight: bold;
text-transform: uppercase;

}
.menu-item0{
background: url(../../images/company.jpg) no-repeat center bottom;


}


.menu-item1{
background: url(../../images/production.jpg) no-repeat center bottom;


}
.menu-item2{
background: url(../../images/news.jpg) no-repeat center bottom;
}
.menu-item3{
background: url(../../images/partners.jpg) no-repeat center bottom;
}
.menu-item4{
background: url(../../images/publications.jpg) no-repeat center bottom;
}
.menu-item5{
background: url(../../images/questions.jpg) no-repeat center bottom;
}
.menu-item6{
background: url(../../images/contacts.jpg) no-repeat center bottom;
}
#ja-cssmenu li a:hover,
#ja-cssmenu li a:active,
#ja-cssmenu li a:focus {
color: #395467;
}

#ja-cssmenu li:hover a,
#ja-cssmenu li.sfhover a,
#ja-cssmenu li.havechildsfhover a,
#ja-cssmenu li.havechild-activesfhover a {
background: url(../../images/mainnav-active.gif) no-repeat center ;
color: #FFFFFF; 
}

#ja-cssmenu li a.active,
#ja-cssmenu li a.active:hover,
#ja-cssmenu li a.active:active,
#ja-cssmenu li a.active:focus {
background: url(../../images/mainnav-active.gif) no-repeat center ;
color: #FFFFFF;
zorro77786 вне форума Ответить с цитированием
Старый 03.08.2009, 14:11   #2
zorro77786
Новичок
Джуниор
 
Регистрация: 10.07.2009
Сообщений: 2
По умолчанию

Задачу решил. Может кому пригодится.
Код:
.menu-item0{
background: url(../../images/company3.jpg) no-repeat center bottom;
}
.menu-item0:hover{
background: url(../../images/company.jpg) no-repeat center bottom;
}
.menu-item0.active{
background: url(../../images/company1.jpg) no-repeat center bottom;
}

.menu-item1{
background: url(../../images/production3.jpg) no-repeat center bottom;
}
.menu-item1:hover{
background: url(../../images/production.jpg) no-repeat center bottom;
}
.menu-item1.active{
background: url(../../images/production1.jpg) no-repeat center bottom;
}
.menu-item2{
background: url(../../images/news3.jpg) no-repeat center bottom;
}
.menu-item2:hover{
background: url(../../images/news.jpg) no-repeat center bottom;
}
.menu-item2.active{
background: url(../../images/news1.jpg) no-repeat center bottom;
}
.menu-item3{
background: url(../../images/publications3.jpg) no-repeat center bottom;
}
.menu-item3:hover{
background: url(../../images/publications.jpg) no-repeat center bottom;
}
.menu-item3.active{
background: url(../../images/publications1.jpg) no-repeat center bottom;
}
.menu-item4{
background: url(../../images/partners3.jpg) no-repeat center bottom;
}
.menu-item4:hover{
background: url(../../images/partners.jpg) no-repeat center bottom;
}
.menu-item4.active{
background: url(../../images/partners1.jpg) no-repeat center bottom;
}
.menu-item5{
background: url(../../images/questions3.jpg) no-repeat center bottom;
}
.menu-item5:hover{
background: url(../../images/questions.jpg) no-repeat center bottom;
}
.menu-item5.active{
background: url(../../images/questions1.jpg) no-repeat center bottom;
}
.menu-item6{
background: url(../../images/contacts3.jpg) no-repeat center bottom;
}
.menu-item6:hover{
background: url(../../images/contacts.jpg) no-repeat center bottom;
}
.menu-item6.active{
background: url(../../images/contacts1.jpg) no-repeat center bottom;
}


.menu-item0{ /*IE 7*/
background: url(../../images/company3.jpg) no-repeat center bottom;
}
.menu-item0:hover{ /*IE 7*/
background: url(../../images/company.jpg) no-repeat center bottom;
}
.menu-item0.focus{ /*IE 7*/
background: url(../../images/company1.jpg) no-repeat center bottom;
}

.menu-item1{ /*IE 7*/
background: url(../../images/production3.jpg) no-repeat center bottom;
}
.menu-item1:hover{ /*IE 7*/
background: url(../../images/production.jpg) no-repeat center bottom;
}
.menu-item1.focus{ /*IE 7*/
background: url(../../images/production1.jpg) no-repeat center bottom;
}
и скрипт

Код:
sfHover = function() {
	var sfEls = document.getElementById("ja-cssmenu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; ++i) {
		sfEls[i].onmouseover=function() {
			clearTimeout(this.timer);
			if(this.className.indexOf("sfhover") == -1)
				this.className+="sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.timer = setTimeout(sfHoverOut.bind(this), 20);
		}
	}
}

function sfHoverOut() {
	clearTimeout(this.timer);
	this.className=this.className.replace(new RegExp("sfhover\\b"), "");
}
zorro77786 вне форума Ответить с цитированием
Старый 18.11.2009, 13:51   #3
Grandsire
Новичок
Джуниор
 
Регистрация: 18.11.2009
Сообщений: 1
По умолчанию

А можно ссылку дать,посмотреть в работе этот вариант?
Grandsire вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Типы данных стандартного класса mauar Общие вопросы Delphi 10 23.05.2009 18:24
Выводится повторное исключение после моего стандартного. prikolist Общие вопросы C/C++ 4 26.03.2009 13:35
При создание edit, в режиме run-time, нет стандартного контекстного меню slips Общие вопросы Delphi 6 08.11.2008 17:05
Замена стандартного Shell'а своим Arigato Win Api 3 02.08.2008 15:53
Нахождение Стандартного отклонения enigma Microsoft Office Excel 1 06.02.2008 16:12