Форуми / Craftwork / Client-side / help please

Kingsley
#1 22.11.2010 01:24
http://www.x-ecutionerz.com/newsite/index.php

I've made this new skin with, which has one error that is quite persistent, in ofcourse, IE.

In opera, ff en chrome it works like a charm, but IE displays the dropbox arrow twice.. :S
I've been through the code dozens of time, and now I think I just don't see it anymore.




it probably is something very small and stupid, but I just don't see it anymore..
ez
#2 22.11.2010 01:39
Looks almost like the onready function gets fired twice ????
add an alert to see if so.
==- I say: Keep it EZ -==
Kingsley
#3 22.11.2010 05:45
huh, add an alert? what do you mean..
GHengeveld
#4 22.11.2010 06:44
If you add an
alert("triggered...");
in the place where the arrow is placed, you can check if it's fired twice. You will get 2 alert popups in that case. Placing an alert is a common way to help debug JS code.
Kingsley
#5 22.11.2010 08:58
only get one popup screen..
ez
#6 22.11.2010 14:35
AHHHH maybe my mistake... (i think i see it now)

<span>
            <li><a href="plug.php?e=contactus">Contact Us</a></li>
            <li><a href="plug.php?e=faq">F.A.Q</a></li>
            <li><a href="plug.php?e=faq&q=1">Recruitement</a></li>
            <li><a href="list.php?c=ranks">=XE= Ranks</a></li>
        </ul>
</span></li>

this span is also triggered by your code... so it appends a span, but there was already one there !

Try this my friend:


$(document).ready(function(){

	$("ul.subnav").parent().append("<span class="dropdownclicker"></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$("ul.topnav li span.dropdownclicker").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
});      


You need to change some css to:

ul.topnav li span.dropdownclicker { /*--Drop down trigger styles--*/
	width: 13px;
	height: 35px;
	float: left;
	background: url(img/subnav_btn.gif) no-repeat center top;

This is just a quick answer, but I think you see what I mean.. and have pointed you in the good direction :)


greetings,

ez

Added 9 minutes later:

Maybe it could even be simpler....

leave your JS code like it was..
just remove the 'extra' span from the HTML.. :)
==- I say: Keep it EZ -==

Відредаговано: ez (22.11.2010 14:47, 13 років тому)
Kingsley
#7 22.11.2010 21:28
Man, I lave you...

It works :D wouldn't have found that on my own.. Although now I learned something new :p
ez
#8 22.11.2010 21:44
you are welcome...
==- I say: Keep it EZ -==