Results 1 to 2 of 2

Good and Nice JavaScripts

This is a discussion on Good and Nice JavaScripts within the Programming forums, part of the Web Designing & Development category; [SIZE=5]JavaScript library[/SIZE] Fisheye Add a 'fisheye' effect to your text. Move your mouse over the text and watch it change. ...

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Location
    JavaScriptBank.com - Free JavaScript Source Code
    Posts
    14

    Default Good and Nice JavaScripts

    [SIZE=5]JavaScript library[/SIZE]

    Fisheye

    Add a 'fisheye' effect to your text. Move your mouse over the text and watch it change. It's implemented using JavaScript and CSS.... detail



    Demo: Fisheye

    [SIZE=4]How to setup[/SIZE]

    Step 1: Copy & Paste CSS code below in your HEAD section
    CSS
    Code:
    <style type="text/css">
      span {font-size: x-small}
    </style>
        <!--
            This script downloaded from w w w.JavaScriptBank. com
            Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
        -->
    Step 2: Place JavaScript below in your HEAD section
    JavaScript
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function convertPreBlocks() {}
    var regular = "x-small";
    function bigger(thing){
        thing.style.fontSize = "large";
        siblingElement = thing.previousSibling;
        while(siblingElement) {
            if(siblingElement.tagName=="SPAN") {
                siblingElement.style.fontSize = "medium";
                break;
            }
            siblingElement = siblingElement.previousSibling;
        }
        siblingElement = thing.nextSibling;
        while(siblingElement) {
            if(siblingElement.tagName=="SPAN") {
                siblingElement.style.fontSize = "medium";
                break;
            }
            siblingElement = siblingElement.nextSibling;
        }
    }
    function normal(thing){
        thing.style.fontSize = regular;
        siblingElement = thing.previousSibling;
        while(siblingElement) {
            if(siblingElement.tagName=="SPAN") {
                siblingElement.style.fontSize = regular;
                break;
            }
            siblingElement = siblingElement.previousSibling;
        }
        siblingElement = thing.nextSibling;
        while(siblingElement) {
            if(siblingElement.tagName=="SPAN") {
                siblingElement.style.fontSize = regular;
                break;
            }
            siblingElement = siblingElement.nextSibling;
        }
    }
    //  End -->
    </script>
        <!--
            This script downloaded from w w w.JavaScriptBank. com
            Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
        -->
    Step 3: Place HTML below in your BODY section
    HTML
    Code:
    The Geek's Raven<br />
    [An excerpt, with thanks to Marcus Bales]
    <br /><br />
    <span onmouseover="bigger(this)" onmouseout="normal(this)">Once upon a midnight 
    dreary,</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">fingers cramped and 
    vision bleary,</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">System manuals piled 
    high and wasted paper on the floor,</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">Longing for the 
    warmth of bedsheets,</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">Still I sat there, 
    doing spreadsheets:</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">Having reached the 
    bottom line,</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">I took a floppy from 
    the drawer.</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">Typing with a steady 
    hand, I then invoked the SAVE command</span><br/>
    <span onmouseover="bigger(this)" onmouseout="normal(this)">But got instead a 
    reprimand: it read &quot;Abort, Retry, Ignore&quot;.</span>
        <!--
            This script downloaded from w w w.JavaScriptBank. com
            Come to view and download over 2000+ free javascript at w w w.JavaScriptBank. com
        -->

  2. #2
    Senior Member
    Join Date
    Mar 2011
    Posts
    110

    Default Re: Good and Nice JavaScripts

    Thanks a lot for sharing your knowledge,this code is very useful.