Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

49 of 106 people (46%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How to make a download dialog box using javascript?

Apr 7th, 2008 22:47
ha mo, Colin Fraser, Geo John,


Not a dialog box as such but you can make an image then using code like
this: 
<span id="sphere" style="position:absolute; width:500; height:50;">
<img src="dot.gif" width="500" height="50">
</span>
<script type="text/javascript" language="JavaScript"><!--
function changeit() {
    if (document.all)
        document.all('sphere').style.clip = 'rect(' + t + ' ' + r + ' '
+ b + ' ' + l + ')';
    else if (document.layers) {
        document.layers['sphere'].clip.top = t;
        document.layers['sphere'].clip.right = r;
        document.layers['sphere'].clip.bottom = b;
        document.layers['sphere'].clip.left = l;
    }
}
var t=0, r=0, b=100, l=0;
function slide(x) {
    if (r<500) {
        r += x;
        changeit();
        setTimeout('slide(x)',500);
    }
}
changeit();
slide(20);
//--></script>
which came from http://developer.irt.org/script/908.htm
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com