Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do you do a floating image?

Featured Replies

  • Author
Hi Rob,

 

Good Question, a really simple and easy to use floating navigation box is here:

 

Floating Navigation Code

 

Also, if you look around the whole of that site, you'll find some other really cool scripts also.

 

Cheers.

 

Ben :)

 

 

Excellent resource, but they didnt tell you were the actual link to the image was, and i know nothing of java so couldnt suss it out. found this though which is self explanitory:

 

<!-- THREE STEPS TO INSTALL LOGO BRANDING:

  1.  Insert the first code into the HEAD of your HTML document
  2.  Add the onLoad event handler to the BODY tag
  3.  the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Put this code into the HEAD of your HTML document  -->

<head>

<script type="text/javascript" language="JavaScript">
<!-- Begin
function setVariables() {
imgwidth=235;  // logo width, in pixels
imgheight=19;  // logo height, in pixels
if (navigator.appName == "Netscape") {
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
innerW="window.innerWidth";
innerH="window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else {
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
innerW="document.body.clientWidth";
innerH="document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
  }
}
function checkLocation() {
objectXY="branding";
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-(imgwidth+30)+currentX;
y=availableY-(imgheight+20)+currentY;
evalMove();
setTimeout("checkLocation()",10);
}
function evalMove() {
eval(docStyle + objectXY + styleDoc + horz + "=" + x);
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}
// End -->
</script>

</head>

<!-- STEP TWO: Add this onLoad event handler to the BODY tag	-->

<body onload="setVariables(); checkLocation();">

<!-- STEP THREE: Put this code into the BODY of your HTML document  -->

<div id="branding" style="position:absolute; visibility:show; left:235px; top:-50px; z-index:2">
<table width="10" bgcolor="#ffffff"><td>
<a href="http://www.rbarclay.co.uk/specials/" onmouseover="window.status='Click here for current specials';return true" onmouseout="window.status=';return true"><img alt="" src="http://www.rbarclay.co.uk/logo.jpg" border="0"/></a></td>
</table>
</div>

</body>

does anyone know if this can be done without using JavaScript? I'm keen to know if it can be done with just CSS - I'm sure I read ages ago somewhere online that it could be done with CSS. I want to do a menu that follows you as you scroll through a website, but don't want to use JavaScript.

  • 2 weeks later...

Oh this is javascript?

I do not know anything about javascript.

And i dont want to know.

Because i hate programming.

Oh this is javascript?

I do not know anything about javascript.

And i dont want to know.

Because i hate programming.

 

why reply?

  • 2 weeks later...

could i do that using html? say, for instance i want the center part of my page not to follow my scroll (since that's where my posts are located) but the sides will be following the scroll since that's where my profile, pictures and links are. thanks. :)

could i do that using html? say, for instance i want the center part of my page not to follow my scroll (since that's where my posts are located) but the sides will be following the scroll since that's where my profile, pictures and links are. thanks. :)

 

Generally that would be done using an iframe... but even then, I'm not sure that the outside scrolling and the inside *not* scrolling would be possible. I'll be watching to see, though!

  • 5 years later...

how do you do the floating image so as you scroll up or down a page the image follows you?

 

 

 

add to style property: style="position: fixed;"

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.