PDA

View Full Version : Newbie...need helps!!!!


newbie257
12-23-2008, 03:52 PM
i am try to add javascript to my project......and i use one from www.javascriptkit.com


this is the code:

<style type="text/css">

#informationbar{
position: fixed;
left: 0;
width: 100%;
text-indent: 5px;
padding: 5px 0;
background-color: lightyellow;
border-bottom: 1px solid black;
font: bold 12px Verdana;
}

* html #informationbar{ /*IE6 hack*/
position: absolute;
width: expression(document.compatMode=="CSS1Compat"? document.documentElement.clientWidth+"px" : body.clientWidth+"px");
}

</style>

<script type="text/javascript">

/***********************************************

* Animated Information Bar- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more

***********************************************/

function informationbar(){
this.displayfreq="always"
this.content='<a href="javascript:informationbar.close()"><img src="close.gif" style="width: 14px; height: 14px; float: right; border: 0; margin-right: 5px" /></a>'
}

informationbar.prototype.setContent=function(data){
this.content=this.content+data
document.write('<div id="informationbar" style="top: -500px">'+this.content+'</div>')
}

informationbar.prototype.animatetoview=function(){
var barinstance=this
if (parseInt(this.barref.style.top)<0){
this.barref.style.top=parseInt(this.barref.style.top)+5+"px"
setTimeout(function(){barinstance.animatetoview()}, 50)
}
else{
if (document.all && !window.XMLHttpRequest)
this.barref.style.setExpression("top", 'document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px"')
else
this.barref.style.top=0
}
}

informationbar.close=function(){
document.getElementById("informationbar").style.display="none"
if (this.displayfreq=="session")
document.cookie="infobarshown=1;path=/"
}

informationbar.prototype.setfrequency=function(type){
this.displayfreq=type
}

informationbar.prototype.initialize=function(){
if (this.displayfreq=="session" && document.cookie.indexOf("infobarshown")==-1 || this.displayfreq=="always"){
this.barref=document.getElementById("informationbar")
this.barheight=parseInt(this.barref.offsetHeight)
this.barref.style.top=this.barheight*(-1)+"px"
this.animatetoview()
}
}

window.onunload=function(){
this.barref=null
}

</script>


<script type="text/javascript">
<!--Invocation code-->

var infobar=new informationbar()
infobar.setContent('Welcome to JavaScript Kit! It appears you are not registered yet on our site. Why wait? <a href="#">Register here</a>')
//infobar.setfrequency('session') //Uncomment this line to set information bar to only display once per browser session!
infobar.initialize()

</script>



or for simple: this is the link....http://www.javascriptkit.com/script/script2/infobar.shtml


This information bar just showing only TEXT........i want to change with showing a banner like new asp page or swf file for a good view and maybe i can add some advertising.........

Can you help me?????


Please explain to me with the code..........(complete)

THX

shyam
12-23-2008, 04:03 PM
newbies' gotta read this (http://www.codingforums.com/showthread.php?t=1510)

Philip M
12-23-2008, 04:05 PM
You have a) posted in the wrong forum
b) failed to use [code] tags
c) given your thread a silly title

Do please read the forum rules and posting guidelines, and then try again.

newbie257
12-23-2008, 04:22 PM
Sorry.....................For placing my thread on wrong place :P

oesxyl
12-23-2008, 06:14 PM
Sorry.....................For placing my thread on wrong place :P
no problem, :)
- edit your post and use tags [ code] and [ /code]
- ask one of the moderators to move the thread in javascript forum
- I don't know if you can do something with the title but try to edit

regards