Log in

View Full Version : asking some question on webpage



notfair
12-26-2007, 09:41 AM
I would like to ask is how to make it like a page will have effect. Im not sure how to say it, like when people visit the site, then enter into the page, then the page wil have effect like fade in or other thing, but I dun want to be done in full page, it just some part of it. Use what to done this? javascript? or other techniq?

a good example is like the deathnote online(currently closed).

SORY FOR MY BAD ENGLISH...

tech_support
12-26-2007, 10:09 AM
Try script.aculo.us (http://script.aculo.us/) or mootools (http://mootools.net/).

codeexploiter
12-26-2007, 10:10 AM
Are you looking for something like this:

http://www.dynamicdrive.com/dynamicindex11/gradualfader.htm

* The script can be customized for your purpose but tell us whether you are looking for this effect or not.

notfair
12-27-2007, 07:33 AM
oh yeha, something like this, thx for help @codeexploiter & @tech_support :)

btw, @codeexploiter,
The function of the fader can have only once, i mean let say i press "Enter the page", then it fader to the next page... something like tat.

codeexploiter
12-27-2007, 08:48 AM
Have a look at the following code



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>DIV Opacity</title>
<style type="text/css">
#test{
zoom: 1;
width: 300px;
border:1px solid #000;
background-color: #c4c5c6;
padding: 5px;
}
</style>
<script type="text/javascript">
var testObj;

function changeOpacity(){
testObj = document.getElementById('test');
for(var i= 0; i <11; i++){
setTimeout('setOpacity('+i+')',100*i);
}
}

function setOpacity(value){
testObj.style.opacity = value/10;
testObj.style.filter = 'alpha(opacity=' + value * 10 + ')';
}

window.onload = function(){
document.getElementById('link').onclick = changeOpacity;
}
</script>
</head>
<body>
<p><a href="#" id="link">Test..</a></p>
<div id="test">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
</body>
</html>



After loading the page in browser click the link 'Test..' and see how the fade-in operation performs on the div element placed just below the link. Then check the JS function setOpacity which changes the opacity of the DIV element.

I've used a function which you can find in the following location with a good account about the processing'

http://www.quirksmode.org/js/opacity.html

Hope this helps