PDA

View Full Version : Expandable Sticky Bar problem



Pete.H
12-01-2010, 11:20 PM
1) Script Title: Expandable Sticky Bar

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex17/stickybar.htm

3) Describe problem:

I work usually in google chrome, i tried this and it worked fine, but in ie it doesn't work. So i cut it down to the bare minimum to see if i could fix it.
Can't make it work in ie, and i know my ie will run it as the one on your site works fine in both browsers.

Anychance someone could let me know where i'm going wrong.

http://shirtdessert.com/test

Thanks

jline
12-02-2010, 12:04 AM
I understand your frustation :)

Can you post your code??

Thanks

jline

Pete.H
12-02-2010, 01:09 AM
<head>

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

<link rel="stylesheet" href="expstickybar.css" />

<script src="expstickybar.js">

/***********************************************
* Expandable Sticky Bar- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

</script>
</head>
<body>
<div id="stickybar" class="expstickybar">

<a href="#togglebar"><img src="open.gif" data-closeimage="close.gif" data-openimage="open.gif" style="border-width:0; float:right;" /></a>
<div style="text-align:center;padding-top:3px"><b>Copyright (c) 2010 Dynamic Drive</a></div>
More content here

</div>
</body>

Thanks
Pete

Pete.H
12-02-2010, 10:01 AM
I forgot to define the <!DOCTYPE HTML>
It now works perfectly. oops :S

DeltaDave
12-06-2010, 05:10 PM
While this is a great little script it is just not useable on pages that are likely to be accessed by a browser that doesn't support Position:Fixed ie Mobile Safari on iPhone, iPad etc.

How would anyone suggest modifying it so that one of these Browsers didn't display ESB content at all.

David

ddadmin
12-07-2010, 09:26 AM
While this is a great little script it is just not useable on pages that are likely to be accessed by a browser that doesn't support Position:Fixed ie Mobile Safari on iPhone, iPad etc.

How would anyone suggest modifying it so that one of these Browsers didn't display ESB content at all.

David

The script currently does detect browsers on desktop that do not support CSS fixed and not show the bar. To do the same for mobile browsers, you might try changing:


if (!cssfixedsupport || window.opera)

inside the .js file to:


if (!cssfixedsupport || window.opera || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i))

The above code is untested, as I do not have an net enabled mobile phone. If it doesn't work, you might try doing a search on google for JavaScript code to detect mobile devises, then add that detection into the original conditional statement above to screen for them.

DeltaDave
12-07-2010, 03:52 PM
Thanks for that - I will try it and report back.
David