PDA

View Full Version : Js Slider Menu help


walkamongus
06-18-2009, 07:48 PM
Ive decided to go with the slider menu for a site Im building. The menu looks fine in firefox but in safari and IE its displaying a "?" on the drop down, as if there is a missing image. I don't understand why, since there are no images in the menu... Here it is, any help will be greatly appreciated!

test url
http://knewdesigns.org/secrets

html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/MAIN.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>test</title>
<!-- InstanceEndEditable -->
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.style1 {
font-size: 24px
}
</style>

<link rel="stylesheet" type="text/css" href="css/jqueryslidemenu.css" />

<!--[if lte IE 7]>
<style type="text/css">
html .jqueryslidemenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]-->

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="css/jqueryslidemenu.js"></script>



<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body>

<div class="content">

<div class="header"><a href="index.html"><img src="images/header.jpg" width="950" height="107" border="0" /></a></div>
<div class="photos"><img src="images/photos.jpg" width="950" height="107" /></div>

<div id="myslidemenu" class="jqueryslidemenu">
<ul>
<li><a href="#">Threats & Victories</a><ul>
<li><a href="account.html">Accountability</a></li>
<li><a href="beliefs.html">Criminalization of Radical Beliefs</a></li>
<li><a href="demonstration.html">Demonstration Rights</a></li>
<li><a href="fbi.html">FBI Guidelines</a></li>
<li><a href="fusion.html">Fusion Centers & Joint Terrorism Task Forces</a></li>
<li><a href="patriot.html">The Patriot Act</a></li>
<li><a href="scapegoat.html">Scapegoating Charities</a></li>
<li><a href="secrets.html">State Secrets Privilege</a></li>
</ul>
</li>
<li><a href="action.html">Take Action</a></li>
<li><a href="books.html">Book Store</a></li>
<li><a href="press.html">Press</a></li>
<li><a href="about.html">About Us</a>
<li><a href="news.html">Newsletter</a></li>
<li><a href="blog">Blog</a></li>
</ul>
<br style="clear: left" />
</div>

<!-- InstanceBeginEditable name="text" -->
<div class="text">
<div align="center" class="headline">Coming Soon!</div>
<p>*****</p>
<div align="center" class="headline">*****</div>
<p>*****</p>
<div align="center" class="headline">*****</div>
*****</div>
<!-- InstanceEndEditable -->
<div class="sidebar">
<div class="donate"><a href="https://www.justgive.org/nonprofits/donate.jsp?ein=95-3922815" target="_blank"> <img src="images/donate.jpg" width="113" height="85" border="0" /></a></div>
<p>Help us protect YOUR right to fight for what you believe in! 99% of our budget comes from individual donors like you, and our bare-bones budget means we pack a lot of advocacy bang for your buck. Please <a href="https://www.justgive.org/nonprofits/donate.jsp?ein=95-3922815" target="_blank">donate!</a></p>
<p align="center" class="style1">Blog</p>
<p align="left">A <a href="#">community forum</a> for civil liberties experts, grassroots activists and you to share your thoughts and analysis on breaking civil liberties issues.</p>
<p align="center" class="style1">Stay Informed</a></p>
<p align="left"><a href="http://org2.democracyinaction.org/o/5492/signUp.jsp?key=282" target="_blank">Sign up</a> now for our free monthly e-newsletter.</p>
</div>
</div>
</body>
<!-- InstanceEnd --></html>
The following three files are in folder "css"
styles.css
@charset "utf-8";
.content {
overflow:hidden;
width:950px;
margin:0 auto;
text-align:center;
border:2px solid #666;
}
.header {
text-align:left;
height: 107px;
width: 950px;
}
.photos {
text-align:left;
height:107px;
width:950px;
}
.text {
float:left;
text-align:left;
padding:10px;
width:660px;
}
.sidebar {
float:right;
text-align:left;
width:250px;
padding:5px;
border-left:2px solid #666;
border-bottom:2px solid #666;
}
.navbar {
height:28px;
width:950px;
background-color:#994285;
font-family:Verdana, Arial, Helvetica, sans-serif;
text-align:center;
border-bottom: 2px solid #666;
}
.navbar ul {padding:5px 0;}
.navbar ul li {display:inline; padding:0px 20px 0px 20px; border-right:1px solid #fff; border-left:1px solid #fff;}
.navbar li.end {border:none;}
.navbar a:link {text-decoration:none; color:#fff;}
.navbar a:visited {text-decoration:none; color:#006;}
.navbar a:hover, a:focus {text-decoration:none; color:#000;}
.navbar a:active {text-decoration:none; color:#006;}

.headline {
font-family: "Times New Roman", Times, serif;
text-align:center;
font-size:30px;
}
.donate {
width:112px;
position: relative;
left: 65px;
}
.left {
width:500px;
margin-bottom: 1px;
position: relative;
}styles/jqueryslidemenu.js
/*********************
//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
//* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/

//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):
var arrowimages={down:['downarrowclass', 'down.gif', 23], right:['rightarrowclass', 'right.gif']}

var jqueryslidemenu={

animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
jQuery(document).ready(function($){
var $mainmenu=$("#"+menuid+">ul")
var $headers=$mainmenu.find("ul").parent()
$headers.each(function(i){
var $curobj=$(this)
var $subul=$(this).find('ul:eq(0)')
this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1? true : false
$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
+'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
+ '" style="border:0;" />'
)
$curobj.hover(
function(e){
var $targetul=$(this).children("ul:eq(0)")
this._offsets={left:$(this).offset().left, top:$(this).offset().top}
var menuleft=this.istopheader? 0 : this._dimensions.w
menuleft=(this._offsets.left+menuleft+this._dimens ions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
if ($targetul.queue().length<=1) //if 1 or less queued animations
$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqu eryslidemenu.animateduration.over)
},
function(e){
var $targetul=$(this).children("ul:eq(0)")
$targetul.slideUp(jqueryslidemenu.animateduration. out)
}
) //end hover
}) //end $headers.each()
$mainmenu.find("ul").css({display:'none', visibility:'visible'})
}) //end document.ready
}
}

//build menu with ID="myslidemenu" on page:
jqueryslidemenu.buildmenu("myslidemenu", arrowimages)jqueryslidemenu.css
.jqueryslidemenu{
font: bold 12px Verdana, Arial, Helvetica, sans-serif;
background: #994285;
width: 100%;
}

.jqueryslidemenu ul{
margin: 0;
padding: 0;
list-style-type: none;
}

/*Top level list items*/
.jqueryslidemenu ul li{
position: relative;
display: inline;
float: left;
}

/*Top level menu link items style*/
.jqueryslidemenu ul li a{
display: block;
background: #994285; /*background of tabs (default state)*/
color: white;
padding: 8px 33px;
color: #2d2b2b;
text-decoration: none;
}

* html .jqueryslidemenu ul li a{ /*IE6 hack to get sub menu links to behave correctly*/
display: inline-block;
}

.jqueryslidemenu ul li a:link, .jqueryslidemenu ul li a:visited{
color: white;
}

.jqueryslidemenu ul li a:hover{
background: #822e73; /*tab link background during hover state*/
color: white;
}

/*1st sub level menu*/
.jqueryslidemenu ul li ul{
position: absolute;
left: 0;
display: block;
visibility: hidden;
}

/*Sub level menu list items (undo style from Top level List Items)*/
.jqueryslidemenu ul li ul li{
display: list-item;
float: none;
}

/*All subsequent sub menu levels vertical offset after 1st level sub menu */
.jqueryslidemenu ul li ul li ul{
top: 0;
}

/* Sub level menu links style */
.jqueryslidemenu ul li ul li a{
font: normal 13px Verdana;
width: 160px; /*width of sub menus*/
padding: 5px;
margin: 0;
border-top-width: 0;
border-bottom: 1px solid gray;
}

.jqueryslidemenuz ul li ul li a:hover{ /*sub menus hover style*/
background: #822e73;
color: black;
}

/* ######### CSS classes applied to down and right arrow images ######### */

.downarrowclass{
position: absolute;
top: 12px;
right: 7px;
}

.rightarrowclass{
position: absolute;
top: 6px;
right: 5px;
}

MagicPower
06-18-2009, 09:32 PM
it's typical IE security. sometimes when you preview in IE and there is a script add on or whatever it displays a little warning message that says: "To help protect your security, ................. i think that could be the issue in IE. click on that message and select allow blocked content n c it makes any changes.

walkamongus
06-18-2009, 10:10 PM
it's typical IE security. sometimes when you preview in IE and there is a script add on or whatever it displays a little warning message that says: "To help protect your security, ................. i think that could be the issue in IE. click on that message and select allow blocked content n c it makes any changes.

Thanks for the reply. Im on a mac and dont have IE. Ive been using browsershots.org to preview. The "?" appears in safari also. I dont understand why it is showing a missing image. :confused:

walkamongus
06-19-2009, 01:18 AM
Found it! There was a strange img tag in the .js (which is mostly gibberish to me). deleted it and the problem is gone. Thanks again for the reply majickpower.