The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

floating script

3 posters

Go down

Solved floating script

Post by newbieQ December 27th 2009, 11:17 am

Floating script in my forum not work.
Before, it work.

I inserted it it overall footer
Code:

<!-- BEGIN switch_user_logged_out -->
<style type="text/css">
#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: black;
color: white;
width: auto;
visibility: hidden;
z-index: 100;
}

</style>

<script type="text/javascript">

/***********************************************
* Floating Top Bar script- ©️ Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose=1 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 0 //set x offset of bar in pixels
var startY = 30 //set y offset of bar in pixels
var verticalpos="frombottom" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document�cookie.length > 0) {
offset = document�cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document�cookie.indexOf(";", offset);
if (end == -1) end = document�cookie.length;
returnvalue=unescape(document�cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document�cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}

function staticbar(){
  barheight=document.getElementById("topbar").offsetHeight
  var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
  var d = document;
  function ml(id){
      var el=d.getElementById(id);
      if (!persistclose || persistclose && get_cookie("remainclosed")=="")
      el.style.visibility="visible"
      if(d.layers)el.style=el;
      el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
      el.x = startX;
      if (verticalpos=="fromtop")
      el.y = startY;
      else{
      el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
      el.y -= startY;
      }
      return el;
  }
  window.stayTopLeft=function(){
      if (verticalpos=="fromtop"){
      var pY = ns ? pageYOffset : iecompattest().scrollTop;
      ftlObj.y += (pY + startY - ftlObj.y)/8;
      }
      else{
      var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
      ftlObj.y += (pY - startY - ftlObj.y)/8;
      }
      ftlObj.sP(ftlObj.x, ftlObj.y);
      setTimeout("stayTopLeft()", 10);
  }
  ftlObj = ml("topbar");
  stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
</script>
<div id="topbar">
........
<a href="" onClick="closebar(); return false">Close</a>
</div><!-- END switch_user_logged_out -->
newbieQ
newbieQ
Forumember

Posts : 57
Reputation : 20

View user profile

Back to top Go down

Solved Re: floating script

Post by Siloow December 27th 2009, 11:21 pm

Enable html
Admin Panel->Messages and Emails->Configuration->Allow HTML : *Yes*
If you don't did or do this it won't work, if you already did this i got no idea how to fix it.

And i found this [works for me] it's a script from dynamicdrive.com, if you got some scripting knowledge you can edit it.

Code:
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>

<layer id="divStayTopLeft">

<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<table border="1" width="130" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" bgcolor="#FFFFCC">
      <p align="center"><b><font size="4">Menu</font></b></td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#FFFFFF">
      <p align="left"> <a href="http://www.dynamicdrive.com">Dynamic Drive</a><br>
      <a href="http://www.dynamicdrive.com/new.htm">What's New</a><br>
      <a href="http://www.dynamicdrive.com/hot.htm">What's Hot</a><br>
      <a href="http://www.dynamicdrive.com/faqs.htm">FAQs</a><br>
      <a href="http://www.dynamicdrive.com/morezone/">More Zone</a></td>
  </tr>
</table>
<!--END OF EDIT-->

</layer>


<script type="text/javascript">

/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/

//Enter "frombottom" or "fromtop"
var verticalpos="frombottom"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
   var startX = 3,
   startY = 150;
   var ns = (navigator.appName.indexOf("Netscape") != -1);
   var d = document;
   function ml(id)
   {
      var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
      if(d.layers)el.style=el;
      el.sP=function(x,y){this.style.left=x;this.style.top=y;};
      el.x = startX;
      if (verticalpos=="fromtop")
      el.y = startY;
      else{
      el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
      el.y -= startY;
      }
      return el;
   }
   window.stayTopLeft=function()
   {
      if (verticalpos=="fromtop"){
      var pY = ns ? pageYOffset : document.body.scrollTop;
      ftlObj.y += (pY + startY - ftlObj.y)/8;
      }
      else{
      var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
      ftlObj.y += (pY - startY - ftlObj.y)/8;
      }
      ftlObj.sP(ftlObj.x, ftlObj.y);
      setTimeout("stayTopLeft()", 10);
   }
   ftlObj = ml("divStayTopLeft");
   stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
Siloow
Siloow
New Member

Posts : 16
Reputation : 0
Language : Dutch. English, HTML | CSS | XML | SQL | Jscript
Location : Goes

View user profile http://warezforums.darkbb.com/forum.htm

Back to top Go down

Solved Re: floating script

Post by newbieQ December 28th 2009, 2:26 am

thanks for reply !
i created a script file & it work
Code:
<script src="link"></script>
problem solved !
newbieQ
newbieQ
Forumember

Posts : 57
Reputation : 20

View user profile

Back to top Go down

Solved Re: floating script

Post by Sanket December 28th 2009, 8:04 am

Since this thread appears to be solved, I will lock this thread and mark it as solved.
floating script 2j4t5a8

Sanket Smile
Sanket
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

View user profile

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum