Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Hlep to floting div for firefox browser


Goto page 1, 2  Next
 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Sat Jun 14, 2008 7:30 am    Post subject: Hlep to floting div for firefox browser Reply with quote

Hi all,

Here i have pasted my floting div javascript which is working fine in IE but it's not working in Firefox browser. Please help me out check this code and let me know why is this not working in Firefox.


while it would floting in firefox it should be fixed position right side in the table itself.

PLZ HELP ME SOONNNNNNNNNNNNNN

Thanks
Raj


<SCRIPT language="JavaScript" type="text/javascript">
// ----------------------------------------
// Detectind user browser
// ----------------------------------------
var Nav = navigator, Ag = Nav.userAgent;
var bIE = (Ag.indexOf('MSIE') >= 0), bMacIE = false;
var bNC = (navigator.appName == "Netscape");
var bOpera = (Ag.indexOf('Opera') >= 0);
var nVer = 0, sTmp = "";
if (bIE) {
sTmp = Ag.substring(Ag.indexOf("MSIE") + 5, Ag.length);
nVer = Math.floor (sTmp.substring(0, sTmp.indexOf(";")));
if (nVer >= 4 && !document.all)
nVer = 0;
if (Ag.indexOf("Mac") >= 0)
bMacIE = true;
}
if (bNC)
nVer = Math.floor (Nav.appVersion.substring (0, Nav.appVersion.indexOf (" ") ) );

bDynamic = (document.all || document.layers) ? true : false;

// ----------------------------------------
// Menu moving functions
// ----------------------------------------
nMenuYPos = 97;
nYDelta = 0;
nPrevScrollPos = 0;

function Spy () {
if (bNC && nVer >= 4) {
if (window.pageYOffset < nMenuYPos - nYDelta)
nNeededPos = nMenuYPos;
else
nNeededPos = window.pageYOffset + nYDelta;
nCurrentPos = document.layers["floatingmenu"].top;

if (nNeededPos == nCurrentPos)
return;

nCurrentPos += Math.round ( (nNeededPos - nCurrentPos) / 4);
document.layers["floatingmenu"].top = nCurrentPos;
}

if (bIE && nVer >= 4 && !bMacIE) {
if (document.body.scrollTop < nMenuYPos - nYDelta)
nNeededPos = nMenuYPos;
else
nNeededPos = document.body.scrollTop + nYDelta;
nCurrentPos = document.all["floatingmenu"].offsetTop;

if (nNeededPos == nCurrentPos)
return;

nDelta = (nNeededPos - nCurrentPos) / 6;
if (nDelta > 0 && nDelta < 0.5)
nCurrentPos += nNeededPos - nCurrentPos;
else
if (nDelta < 0 && nDelta >= -0.5)
nCurrentPos --;
else
nCurrentPos += Math.round (nDelta);

pnt = document.all ["floatingmenu"].style;
pnt.top = nCurrentPos;
}
}

function ScriptStart () {
if (bNC && nVer >= 4)
setInterval ("Spy ()", 10);
if (bIE && nVer >= 4 && !bMacIE)
setInterval("Spy ()", 10);


}

bScriptLoaded = true;
</SCRIPT>

<body onload="ScriptStart ();">
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Sat Jun 14, 2008 9:00 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

IE and FF both throwing a good number of errors at my end.
Back to top
View user's profile Send private message Yahoo Messenger
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Sat Jun 14, 2008 9:24 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

Hi Rangana help me na why it's not working in firefox. see the rul www.resourcepoint.net in firefox browser and let me know soon plzzzzzzzzzzzzz
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Sat Jun 14, 2008 10:06 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

Your code considers the obsolete browsers (Netscape) which I'm having difficulty moving into a cross-browser script since I'm not seeing any effect.

You might find DD useful for your DHTML/HTML/AJAX needs Wink

Hope it keeps you going.
Back to top
View user's profile Send private message Yahoo Messenger
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Sat Jun 14, 2008 11:53 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

Thanks Rangana but could u send me link any floating div which will work for firefox and ie and fixed in the table also
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Sat Jun 14, 2008 11:58 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

You're not searching, don't you?
http://www.dynamicdrive.com/dynamicindex1/staticmenu.htm
Back to top
View user's profile Send private message Yahoo Messenger
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Sat Jun 14, 2008 1:02 pm    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

Hi Rangna,

Thanks for ur reply, this code is working for both browser but what i need is, it should fixed there while floting. make it right align, it will float in right side of the browser. If u will make ur browser window small side then also it will float right side cornor of the browser but i don't want like this i need it should fix there it self if u will check in different resolution also it should be fixed in the same position. I want that type of code which would work for both browser. thanks if u would give me that type of floating script. plz give me if u could find like that any ...............
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Sat Jun 14, 2008 1:40 pm    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

I've created one for you. Hope this helps:
Code:

<script type="text/javascript">
/**************************************
* Script by Raymond Angana
* rangana in Devppl.com/forum
* Title: Floating script cross-browser
* Created: June 14, 2008
* This notice must stay intact
/**************************************/
window.onresize=adRangjust;
window.onload=adRangjust;
function adRangjust()
{
   var adfloat='right', // Change the value to left if you want it to float on left
   topmar=10, // Margin from the top of the screen
   sidemar=10, // Margin from the sides
   bh=document.body.clientHeight, // Find the clients height
   bw=document.body.clientWidth, // Find the clients width
   pos='absolute', // Choose from these three pos value: absolute, fixed, relative
   mydiv=document.getElementById('myfloatingdiv'); // ID of your floating div
   
   /*****************No need to edit beyond this part***************/
   
   mydiv.style.position=pos;
   mydiv.style.top=topmar+'px';
   if(adfloat=='right') mydiv.style.right=sidemar+'px';
   else mydiv.style.left=sidemmar+'px';
   
}
</script>
<div id="myfloatingdiv" style="padding:10px;width:100px;border:1px solid #222;">
This is my floating div. It stays in this position and adjust on screen's height and width.
</div>
Back to top
View user's profile Send private message Yahoo Messenger
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Mon Jun 16, 2008 11:53 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

Hi Rangana,

Thanks for keep in touch. Still am there, am not getting the right code. just u ckech this url in IE www.resourcepoint.net. how it is floating right side in 1280 resolution. if u would check in 1024 resolution then also it won't move from his place. like that i want to work for FireFox Browser which is not working now.

Plz help me to get a right code. am also searching.

Waitiig for ur positive Reply

Thanks
Raj
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Wed Jun 18, 2008 9:27 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

Hi,

Anybody is there who could help me out? just check this url in IE & FireFox www.resourcepoint.net. that right side floating table it's working fine in IE But in firefox it's not working and u view in any resolution it won't change from his position. i have pasted that div in td.

Plz help me out since last few days am trying for this but am not getting the right solutions.

Thanks
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Wed Jun 18, 2008 9:42 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

Then, this issue could be fix without JS being involved, but by CSS alone.

Use a fixed layout.

Hope it keeps you going Wink
Back to top
View user's profile Send private message Yahoo Messenger
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Wed Jun 18, 2008 9:47 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

This blogs are for help or to pass comments each other?
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Wed Jun 18, 2008 9:49 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

What do you mean?

Last edited by rangana on Wed Jun 18, 2008 10:08 am; edited 1 time in total
Back to top
View user's profile Send private message Yahoo Messenger
raj2476



Joined: 14 Jun 2008
Posts: 12
Location: Hyderabad

PostPosted: Wed Jun 18, 2008 9:57 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

sorry that msg was wrongly posted

Hey Rangana plz help to find source and plz provide me source file before that u plz check this site in higher resolution. www.resourcepoint.net
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Wed Jun 18, 2008 10:12 am    Post subject: Re: Hlep to floting div for firefox browser Reply with quote

They are doing it in a table, and is using a fixed layout. View their source and use Navigation as the keyword on Find Dialog.

You'll be directed to navigation.gif, it's the image on the right side. Read the codes and you'll fully understand how it was done.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap