Saint Michaels Dhtml Issue #1 - the ever popular series is back in dhtml

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Tutorials

Saint Michaels Dhtml Issue #1 - the ever popular series is back in dhtml

Saint_Michael
well since my series is becoming such a big hit im going to go into dhtml and lets start of with some beginner stuff so to speak.

all scripts are coming from dynamic drive

Ok menu and navagation is a big part of your website now for those who have lots of info the requires the user to scroll down this menu will help out when you scroll the menu goes down with it so heres the script.
QUOTE
<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>

The next menu/navagation is good for those who have small sites. this one uses a drop down menu but also gives a brief description on what the link contains so here we go also this comes into 2 parts so read the directions carefully.
QUOTE
<!--Example drop down menu 1-->

<form name="form1">
<select name="select1" size="1" style="background-color:#FFFFD7" onChange="displaydesc(document.form1.select1, thetext1, 'textcontainer1')">
<option selected value="http://www.javascriptkit.com">JavaScript Kit </option>
<option value="http://freewarejava.com">Freewarejava.com</option>
<option value="http://wired.com" target="newwin">Wired News</option>
<option value="http://www.news.com">News.com</option>
<option value="http://www.codingforums.com" target="newwin">Coding Forums</option>
</select>
<input type="button" value="Go"
onClick="jumptolink(document.form1.select1)"><br>
<span id="textcontainer1" align="left" style="font:italic 13px Arial">
</span>
</form>

<!--Example drop down menu 2-->

<form name="form2">
<select name="select2" size="1" style="background-color:#E3FFDF" onChange="displaydesc(document.form2.select2, thetext2, 'textcontainer2')">
<option selected value="http://www.cnn.com">CNN</option>
<option value="http://www.msnbc.com">MSNBC</option>
<option value="http://news.bbc.co.uk">BBC News</option>
<option value="http://www.theregister.com/">The Register</option>
</select>
<input type="button" value="Go"
onClick="jumptolink(document.form2.select2)"><br>
<span id="textcontainer2" align="left" style="font:italic 13px Arial">
</span>
</form>

<!--IMPORTANT: Below script should always follow all of your HTML codes above, and never proceed them-->
<!--To be safe, just add below script at the end of your page-->


<script type="text/javascript">

/***********************************************
* Drop down menu w/ description- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//1) CUSTOMIZE TEXT DESCRIPTIONS FOR LINKS ABOVE
var thetext1=new Array()
thetext1[0]="Comprehensive JavaScript tutorials and over 400+ free scripts"
thetext1[1]="Direct link to hundreds of free Java applets online!"
thetext1[2]="Up to date news on the technology front"
thetext1[3]="News.com- The #1 technology News site."
thetext1[4]="Web Coding and development forums"

/// You may define additional text arrays if you have multiple drop downs:
var thetext2=new Array()
thetext2[0]="CNN- US and World News."
thetext2[1]="MSNBC- NBC News online."
thetext2[2]="BBC News- Updated every minute of every day."
thetext2[3]="TheRegister- Daily IT news."

// Now, see 2) below for final customization step

function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedInde
x]
}

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value)
else
window.location=selectedopt.value
}

//2) Call function displaydesc() for each drop down menu you have on the page
//  This function displays the initial description for the selected menu item
//  displaydesc(name of select menu, name of corresponding text array, ID of SPAN container tag):
//  Important: Remove the calls not in use (ie: 2nd line below if there's only 1 menu on your page)

displaydesc(document.form1.select1, thetext1, 'textcontainer1')
displaydesc(document.form2.select2, thetext2, 'textcontainer2')

</script>[/COLOR]


ok next we are going to into scrollers or marquee news for the website, lettings people know any updates to the website in cool fashion so lets check this one out
QUOTE
<script language="JavaScript1.2">

/*
Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth="200px"
//Specify the marquee's height
var marqueeheight="150px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=2
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee's content
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var marqueecontent='<font face="Verdana">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a><p>If you find this script useful, please consider linking to us by <a href="../link.htm">clicking here.</a><p>Visit our partner <a href="http://javascriptkit.com">JavaScript Kit</a> for JavaScript tutorials.</font>'


////NO NEED TO EDIT BELOW THIS LINE////////////

marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualheight=cross_marquee.offsetHeight
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.top=parseInt(marqueeheight)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualheight=ns_marquee.document.height
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){

if (iedom){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}
else if (document.layers){
if (ns_marquee.top>(actualheight*(-1)+8))
ns_marquee.top-=copyspeed
else
ns_marquee.top=parseInt(marqueeheight)+8
}
}

if (iedom||document.layers){
with (document){
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;">')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
}
}
</script>

this next script is for form this script let user know what fields are important to fill out yeah their are scripts mostly php that make fill out the info before click or your brought back but what they its scriptig at its best. also this is a two step process so read carefully
QUOTE
<script language="JavaScript1.2">

/*
Flashing form element Script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, visit http://www.dynamicdrive.com/
This credit MUST stay intact for use
*/

var flashcolor="red"
var flashinterval=1000 //flash interval in miliseconds (1000=1 sec)

var formcollect=document.getElementsByTagName? document.getElementsByTagName("FORM") : document.all? document.all.tags("FORM") : new Array()
var flashcollect=new Array()

for (i=0; i<formcollect.length; i++){
for (e=0; e<formcollect[i].elements.length; e++){
if (formcollect[i].elements[e].className=="flashit")
flashcollect[flashcollect.length]=formcollect[i].elements[e]
}
}

function flashelements(){
for (f=0; f<flashcollect.length; f++){
if (flashcollect[f].style.color=='')
flashcollect[f].style.color=flashcolor
else
flashcollect[f].style.color=""
}
}

if (flashcollect.length>0)
setInterval("flashelements()",flashinterval)

</script>

the nex part is simple just add the following
QUOTE
Having done the above, you're now ready to give any form element a flashing personality. Just add:

class="flashit"

inside the element's tag you wish to flash. Here's an example:

<form>
<input type="submit" value="Submit" class="flashit">
</form>

this next dhtml script is use for link/tooltip, basical its like a floating text giving you some info on the link a lot of sites use this kind and many other variations of it as well so hers one for you people to chomp down on

first part you had in the <head> tag area
QUOTE
<style type="text/css">

#dhtmlfloatie{
position: absolute;
left: 0;
left: -900px;
filter:alpha(opacity=0);
-moz-opacity:0;
border: 2px solid black;
padding: 5px;
z-index: 100;
}

</style>

<script type="text/javascript">

/***********************************************
* Link Floatie script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var floattext=new Array()
floattext[0]='- <a href="http://www.javascriptkit.com/cutpastejava.shtml">Free JavaScripts</a><br>- <a href="http://www.javascriptkit.com/javaindex.shtml">JavaScript Tutorials</a><br>- <a href="http://www.javascriptkit.com/dhtmltutors/index.shtml">DHTML/ CSS Tutorials</a><br>- <a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a><br><div align="right"><a href="javascript:hidefloatie()">Hide Box</a></div>'
floattext[1]='Some other floatie text'

var floatiewidth="250px" //default width of floatie in px
var floatieheight="60px" //default height of floatie in px. Set to "" to let floatie content dictate height.
var floatiebgcolor="lightyellow" //default bgcolor of floatie
var fadespeed=70 //speed of fade (5 or above). Smaller=faster.

var baseopacity=0
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",fadespeed)
}

function instantset(degree){
cleartimer()
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

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

function paramexists(what){
return(typeof what!="undefined" && what!="")
}

function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var floatobj=document.getElementById("dhtmlfloatie")
floatobj.style.left="-900px"
floatobj.style.display="block"
floatobj.style.backgroundColor=paramexists(optbgColor)? optbgColor : floatiebgcolor
floatobj.style.width=paramexists(optWidth)? optWidth+"px" : floatiewidth
floatobj.style.height=paramexists(optHeight)? optHeight+"px" : floatieheight!=""? floatieheight : ""
floatobj.innerHTML=thetext
var floatWidth=floatobj.offsetWidth>0? floatobj.offsetWidth : floatobj.style.width
var floatHeight=floatobj.offsetHeight>0? floatobj.offsetHeight : floatobj.style.width
var winWidth=document.all&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winHeight=document.all&&!window.opera? ietruebody().clientHeight : window.innerHeight
e=window.event? window.event : e
floatobj.style.left=dsocx+winWidth-floatWidth-5+"px"
if (e.clientX>winWidth-floatWidth && e.clientY+20>winHeight-floatHeight)
floatobj.style.top=dsocy+5+"px"
else
floatobj.style.top=dsocy+winHeight-floatHeight-5+"px"
slowhigh(floatobj)
}

function hidefloatie(){
var floatobj=document.getElementById("dhtmlfloatie")
floatobj.style.display="none"
}

</script>

next you add this is the <body> tag area
QUOTE
<div id="dhtmlfloatie" ></div>

<a href="#" onMouseover="showfloatie('Web coding and development forums. Get help on JavaScript, CGI, PHP, CSS, and more.', event)" onMouseout="hidefloatie()">Coding Forums</a> | <a href="#" onMouseover="showfloatie(floattext[0], event, '#D9FFD9', 250, 100)">JavaScript Kit</a>

now for this this floating tooltip other options can be done but to make it siomple heres the link for that infoclick here

well that for the day look for issue #2 as well cover more things dhtml

 

 

 


Reply

tom169
I use dynamic drive alot
very good script website

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : saint, michaels, dhtml, issue, 1, popular, series, back, dhtml

  1. Making The Popular Id Browsing For Your Site.
    (17)
  2. Installing A Phpbb2 Skin
    Popular forum software (5)
    I tried installing a new phpbb2 forum skin on my website for weeks and didnt get it to work, but
    it's very easy... 1. Upload the skin / template to the templates folder of your phpbb2
    directory (eg. public_html/forums/templates), make sure you don't upload the zip archieve or a
    directory containing the directory where the template is in, the folder you need to upload usually
    contains a lot of .tpl files an images directory a .css file (or multiple) and if your template
    contains an admin re-skin an "admin" folder. NOTE: If you use PHP-Nuke the directory where....
  3. Saint-michaels Html Tips And Tricks #4
    been awhile so here somewhat new stuff (12)
    WEll its been awhile since i did so i will put up some more useful html tips and tricks here on
    trap17.com Ok for trick actually, want to know how some websites got those ool icons put on their
    website link in the favorites folder well here you go in 3 quick steps. 1. create an image then
    shrink it down to 16x16 and save it as avicon .bmp. 2. then change it to .ico, when is the file
    reconizing it as a icon., if you are having problems saving it, there are some resources out there
    that can change it for you. 3. load the image to your website and add this tag in betwee....
  4. Saint Michael's Dhtml Tips And Tricks Issue #2
    well i thought i catch up in my issues so heres some more (0)
    Todays is were are going to do some text effects that should be interesting for some people, the
    first one we are going to talk about is the matrix scrolling text effect, if you seen the moives and
    about 99% of you have then you know about hte computer screens now you can do it. this is done in a
    2 step process. STEP 1: Insert this script in the head tags QUOTE .matrix {
    font-family:Lucida Console, Courier, Monotype; font-size:10pt; text-align:center; width:10px;
    padding:0px; margin:0px;} <script type="text/javascript" language="JavaScript"> <!--....
  5. Saint-michael Html Tips And Tricks Issue #3
    exploring meta tags and what uses they have (0)
    Todays issue we are going to talk about a bunch of good newbie stuff. The first is meta tags to
    make it easy use a generator, from my searches on the internet ther are soe many meta tags to use
    its not even funny but for those whoe like them is are the more common ones that are used for a
    website. QUOTE also for a dynamic look using the meta this called page
    fading so to speak, what it does when you click on a link the website will fade for a duration of
    time to the next page on your site warning it doesn't do anything when you first cl....
  6. Saint Michael Xhtml Tips And Tricks #1
    xhtml= html 5.0 :P (3)
    Well by the many views i have seen on my web design issues i should go into new territory, so im
    going start with some useful xhtml info for you web design fenatics, the info i present to you is
    from other websites so be warned it might or might not work all depends but lets start off with the
    basic info for using xhtml. Also this tutorial is for beginners so i won't be doing any xml
    info due to it being a more server side then actually webdesign 1. DOCTYPE this is used to tell
    the browser what kind of infomation it will be displaying. nothing as really changed....
  7. Saint Michael Css2 Tips And Tricks Issue #1
    css tips and tricks for you beginners and experts (1)
    since my htmls tips and tricks issues are hot on the forum i decided to do some css stuff so lets
    get to work all you beginners and experts. Also note to those who read this is coming from other
    websites so i am not claming any rights to this info even though some people think if they make it,
    its theirs which is bs cuz if that were true then there would not be to many websites on the
    internet now would their?. Ok the scripting im using for right now is the the actually scripting
    on the website without external linking first css trick that is sometimes good to use is....
  8. Saint-michaels Html Tips And Tricks Issue # 2
    some more tricks of the trade and some wierd stuff to (2)
    Well i thought it was time to bring in issue 2 of html tips and tricks and i found a very
    interesting html coding which i thought was funny as hell its called Preventing Search Engine
    Indexing this coding is used to keep your website from being index why i don't know why you
    don't want you website listed unless it someone stupid as in telletubbies.com but heres the code
    This tag tells the robots not to index this page and not to follow any links within the
    page. QUOTE This tag tells the robots not to index this page, but follow any links wit....
  9. Saint_michael Html Tips & Tricks Issue #1
    useful html stuff (1)
    this little trick i though was useful it used to send a visitor to another page using meta tag and
    it sends the user to another page with in a few seconds for example you will go to the new page in 5
    seconds CODE <META HTTP-EQUIV=REFRESH
    CONTENT="5;URL=http://www.yoursitehere.com"> and for those have a good knowledge
    of javascript they could use this script right here CODE <html> <head>
    <title>Refresh Page</title> <script language="JavaScript">
    <!-- var time = null function move&#....
  10. How To Fix Dns Issue When You Created A New Subdomain!
    This is for XP & W2K computers and similar for other M$ OS (1)
    DNS issues with XP or W2K computers not able to access your new web site. This solution works
    for all M$ based operating systems and this tutorial is written for XP computer with high speed
    Internet connections. Dialup is a different animal. The issue is you can access trap17 and read the
    board, but as soon as you created your sub-domain name the computer don't connect to your new
    web site and you are stuck. You can access cPanel using the IP address but not your new site. Part
    of the problem is how domain names propagate across the Internet. All name serve....

    1. Looking for saint, michaels, dhtml, issue, 1, popular, series, back, dhtml

Searching Video's for saint, michaels, dhtml, issue, 1, popular, series, back, dhtml
advertisement



Saint Michaels Dhtml Issue #1 - the ever popular series is back in dhtml



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE