Jump to content

HTML/Javascript/CSS Help


eyehawk78

Recommended Posts

Here's one you can use:

 

 

 

http://www.berzerk.co.uk/box/BOX.zip

 

 

 

And here's a demo:

 

 

 

http://www.berzerk.co.uk/box/

 

 

 

TTFN,

 

Clare.

 

 

 

Eek that's complicated :? I'll see what I can learn from it. Thanks!

Link to comment
Share on other sites

P.s. Just another quick question though, does anyone know how to get the box to display to the left hand side of the pointer, if the box will appear off the right hand side of the page?

 

 

 

I don't have any complete code for you(don't have time to bulid and test). However, you would need to get the viewable width of your page.

 

Subtract the e.clientX from your viewable width. If the result is less than the width of your floating div, then you will need to adjust to the left(e.clientX - divwidth - arbitraryamountyoudecide). e.clientX is your mouse position when the event was called. If it's at point 442, your page width is 500, and you div witdh is 100, then it isn't going to fit without running over the page.

 

 

 

Here are two functions for getting the viewport width and height of the page

 


function pageWidth()



{



	return window.innerWidth || (document.documentElement.clientWidth || document.body.clientWidth);



}



function pageHeight()



{



    return window.innerHeight || (document.documentElement.clientHeight || document.body.clientHeight);



}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.