/    Sign up×
Community /Pin to ProfileBookmark

javascript floating menu

I am trying to modify a floating menu script. It stays x pixels from the left of the page and y pixels from the top. It scrolls with the page and always stays at those coordinates.

My problem is when the window size becomes really tiny (at 800×600 not full screened) it covers up the image in the bottom left hand corner. I want the menu to be bumped up when it hits the corner image (203px from bottom).

I am not a js master and I need someone who can help me out. From people I’ve talked to it doesn’t seem that difficult to do but I haven’t had any luck yet. Please help me out if you can.

To get an idea of what I’m talking about visit [url]http://www.dentalassociatespa.com/salesianum.org/thing.htm.[/url]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@arturionAug 23.2003 — You should try to give a different size to the image depending of the resolution of the users's screen

this works in internet explorer

<head>

<script languaje="javascript">

<!--

if(screen.height==800 && screen.width==640){

image_height=200;

image_width=200;

}

if(screen.height==1024 && screen.width==768){

image_height=400;

image_width=400;

}

-->

</script>

<body>

<div id="layer_1">

<img src="yourimage.gif" width=image_width height="image_height">

</div>


so,the image has a different size depending on the resolution of the client

I hope it will be useul to you

bye
Copy linkTweet thisAlerts:
@AdamBrillAug 23.2003 — I don't know if that is what you wanted or not, but arturion's obviously untested code won't work right. Try this:&lt;script type="text/javascript"&gt;
&lt;!--
if(screen.height&lt;=800){
document.write('&lt;img src="yourimage.gif" border=1 width="200" height="200"&gt;');
}else{
document.write('&lt;img src="yourimage.gif" border=1 width="400" height="400"&gt;');
}
--&gt;
&lt;/script&gt;
×

Success!

Help @dotted_line spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...