Centre for Software Practice

the blog
Welcome to Centre for Software Practice Sign in | Join | Help

Javascripts

Simple Show/Hide

<span
                    style="text-decoration: underline; cursor: pointer; color: Blue;" onclick="if(this.innerHTML == 'Show Details') {this.innerHTML = 'Hide Details'; document.getElementById('spanSathyaSaiBabaInfo').style.display = 'inline';} else {this.innerHTML = 'Show Details';document.getElementById('spanSathyaSaiBabaInfo').style.display = 'none';}">Show
                    Details</span><br />
                <span id="spanSathyaSaiBabaInfo" style="display: none;">The Sathya Sai Baba Relocation
                    Allowance is a $1500 relocation allowance payment for female international graduates
                    from universities in Sri Lanka, India, Nepal, Bangladesh and Pakistan, who intend
                    to enrol in a higher degree by research at The University of Western Australia.<br />
                </span>

image rotater

 <div id="imagelink1"></div>

<div id="imagelink2"></div>
<div id="imagelink3"></div>
<div id="imagelink4"></div>



<script language="JavaScript" type="text/javascript">
<!--

var currenthtmlimage = 1;
var currentlinkdb = 1;
var htmlimagecount = 4;

var linkdblinks = new Array( "http://www.daa.com.au/",
"http://www.csp.uwa.edu.au/",
"http://www.uwa.edu.au/");

var linkdbimages = new Array(
"http://gemini.csp.uwa.edu.au/images/Type_Bug.jpg",
"http://gemini.csp.uwa.edu.au/images/GeminiLogo.jpg",
"http://gemini.csp.uwa.edu.au/images/Priority_ShowStopper.gif");

var t;
function changeimagenow()
{
var imagelink = document.getElementById("imagelink" + currenthtmlimage);
imagelink.innerHTML = "<a href=\""+ linkdblinks[currentlinkdb] +"\"><img src=\""+ linkdbimages[currentlinkdb] +"\" /></a>";

if(currenthtmlimage == htmlimagecount)
{currenthtmlimage=1;}
else
{currenthtmlimage+=1;}

currentlinkdb+=1;
if(currentlinkdb >= linkdblinks.length)
{currentlinkdb=0;}

t=setTimeout("changeimagenow()",1000)
}

changeimagenow();

//-->
</script>

Confirm Popup on Button Click

Set the submit behaviour to false and put this javascript into the button description:

OnClientClick="if(!confirm('Message goes here')) return false;"

About This Page

Title: Javascripts
Moderated By:
Created: 07-12-2007, 10:14 AM
Modified: 07-18-2007, 11:10 AM
Last Modified By: adam.n
Revision Number: 2
Powered by Community Server (Personal Edition), by Telligent Systems