|
|
JavaScript Code |
1 |
jQuery('#box1').animate({ bottom: '-=300px' }, 2000 ); |
Moin,
im Prinzip kannst du einfach das Beispiel von der Seite verwenden, bei dir würde es das so aussehen
![]()
JavaScript Code
1 jQuery('#box1').animate({ bottom: '-=300px' }, 2000 );
die 2000 definiert in Millisekunden die Animationsdauer, das html-element mit der id box1 wird hier verschoben, klar.
soweit ich weiß muss besagte box1 absolut positioniert werden. Deswegen manipuliere ich auch mit der animate-Methode das CSS-Attribut bottom, nicht margin-bottom.
|
|
Source code |
1 2 3 4 5 6 |
<div class="info" id="i2"> INF </div> <div class="info" id="i1"> INF </div> |
|
|
JavaScript Code |
1 |
jQuery('#mutterElement').append('<div class="info" id="i3">INF</div>') |
|
|
JavaScript Code |
1 2 3 4 5 6 7 8 9 10 11 |
function check_info() { $.ajax({ url: "testinfo.php", context: document.body, success: function(data){ if(data != "false") { $.ajax({ url: "testinfo.php", type: 'GET',data: 'bod=true', context: document.body, success: function(bod){ new_info(data,bod); } }); } ]}}); } setInterval("check_info()",5000); |
|
|
JavaScript Code |
1 |
if(!data) { /* ... */ } |
|
|
JavaScript Code |
1 2 3 4 5 6 7 8 |
function check_info() { $.ajax({ url: 'testinfo.php', success: function(result) { if(!$result) { /* ... */ } } }); } |
Quoted
INF<>Das ist ein Infotext
|
|
JavaScript Code |
1 2 3 4 5 6 7 8 9 10 11 12 |
function check_info() { $.ajax({ url: 'testinfo.php', success: function(result) { if(result != "") { var splitted_text = result.split("<>"); new_info(splitted_text[0],splitted_text[1]); } } }); } |
