Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mislz28/public_html/wp-content/themes/css-faq-v2/timeweather/timeweather.php on line 19
8 May 2008

forum

Current User: Guest Login Register
Please consider registering

Search 
Search Forums:


 




выпадение div

UserPost

5:52 pm
June 17, 2008


creek

Member

posts 8

1

можно ли сделать эффект выпадения div с задержкой в миллисекундах. Т.е. эффект плавного выезжания. ? 


Если можно, подскажите, пожалуйста, как решить данную задачу с этим отрывком кода:

Код:

function showhidemenu(div_id) 

   if (document.getElementById(div_id).style.display == 'none') 

   { 

      document.getElementById(div_id).style.display=''; 

   } 

   else 

   { 

      document.getElementById(div_id).style.display='none'; 

   } 

   }

Здесь div_id - это индетефикатор сгенерированный php-скриптом

5:53 pm
June 17, 2008


hohol

Member

posts 35

2

Код:

<script>
var interval = 10;
var action = '';

function show( divId, maxHeight )
{
var div = document.getElementById( divId );
if ( null == div || undefined == div )
{
return false;
}

if ( action == 'showing' && parseInt(div.style.height) < maxHeight )
{
var height = parseInt(div.style.height);
div.style.height = height + 10 + 'px';
setTimeout( 'show( “' + divId + '”, ' + maxHeight + ' )', interval );
}
else
{
( action == 'showing' ) ? action = '' : null;
}
}

function slideDownDiv( divId, height )
{
if ( action == '' )
{
action = 'showing';
show( divId, height );
}
}

function hide( divId, minHeight )
{
var div = document.getElementById( divId );
if ( null == div || undefined == div )
{
return false;
}

if ( action == 'hiding' && parseInt(div.style.height) > minHeight )
{
height = parseInt(div.style.height);
div.style.height = parseInt(height - 10) + 'px';
setTimeout( 'hide( “' + divId + '”, ' + minHeight + ' )', interval );
}
else
{
( action == 'hiding' ) ? action = '' : null;
}
}

function slideUpDiv( divId, height )
{
if ( action == '' )
{
action = 'hiding';
hide( divId, height );
}
}
</script>
<div style=”width: 500px; height: 500px; background: #ffeeee”>
<div style=”width: 300px; height: 300px; background: #eeffee; overflow: hidden” id=”showingDiv”>
<span><!– без него (span) ие будет выделываться –>
qweqwe<br>
asdasdasd<br>
asdasdasd<br>
asdasdasd<br>
asdasdasd<br>
asdasdasd<br>
asdasdasd<br>
asdasdasd<br>
zxczxczxc
</span>
</div>
</div>
<div>
<input type=”button” onclick=”slideDownDiv( 'showingDiv', 300 )” value=”show div”>
<input type=”button” onclick=”slideUpDiv( 'showingDiv', 0 )” value=”hide div”>
</div>

5:53 pm
June 17, 2008


creek

Member

posts 8

3

ого! Сасибо!



Reply to Topic: выпадение div

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 6 + 1        (Required)

Topic Reply:


 

About the CSS-FAQ forum

Currently Online:

1 Guest

Maximum Online: 20

Forums:

Groups: 3

Forums: 18

Topics: 397

Posts: 834

Members:

There are 1000 members

There are 1 guests

Top Posters:

abc - 57

genius - 47

shane - 46

glowlite.uk - 39

booster - 37

warren - 35

Administrator: admin | Moderators: admin


© Simple:Press Forum - Version 3.1.1 (Build 336)