[UPHPU] jQuery and Opera Bug

Brandon Stout bms at mscis.org
Wed Oct 24 12:44:39 MDT 2007

Craig Jackson wrote:
> You guys are very helpful, so I am coming to you with this problem I cannot figure out a solution for. Usually the reliable communities have addressed my issues, but I could not find any helpful info.
> In Opera, I have a major layout crisis just from one line of jQuery.
> $("ul#blogs").hide();
> If that line is taken out, the layout loads exactly how I want it to. But, then the list loads shown. I want the list of blogs hidden onload. However, I want them to toggle on and off with the click of a link.
> $("a#showblogs").click(function() {
> 	$("ul#blogs").toggle();
> 	return false;
> });
> I threw together a menu to give you an idea of what I want the HTML to be:
> <div id="menu">
> 	<ul>
> 		<li><a href="index.html">Home</a></li>
> 		<li><a href="index.html">Portfolio</a></li>
> 		<li><a id="showblogs" href="blogs.html">Blogs</a>
> 			<ul id="blogs">
> 				<li><a href="index.html">Blog 1</a></li>
> 				<li><a href="index.html">Blog 2</a></li>
> 			</ul>
> 		</li>
> 		<li><a href="index.html">About Me</a></li>
> 		<li><a href="index.html">Contact Me</a></li>
> 	</ul>
> </div>
> There is no problem with viewing this in IE or Firefox. Plus, when you click an index.html link (refreshing itself), then Opera loads the layout in a correct fashion. Im sure it is a simple mistake that is just lapsing my mind.
> Thanks for the help,
> Craig Jackson

The only thing that comes to mind for me is this:  Make sure that you do
not use id="menu", id="showblogs", or id="blogs" for any element
anywhere else on that page.  Personally, I'd use class="menu" and so
forth instead of id attributes so you can reuse it.

Brandon Stout

More information about the UPHPU mailing list