Login

russian armor

Little javascript snippet for the livestream show/hide

8 Dec 2012, 20:04 PM
#1
avatar of JAnx
Coder Red Badge

Posts: 487 | Subs: 1

In the following javascript "http://www.coh2.org/min/serve/g/cacheAvoidingHashGibberishThingy/lm/1354221175"; there is a following line:

Code
$('#livestream_view_list table.offline').fadeToggle("slow");


Imho this could be nicer with fade and slide toggle.

Code
$(this).closest('#livestream_viewContainer').find('.offwhite_box').eq(1).animate({height: 'toggle', opacity: 'toggle'}, 'slow');


The selector should be improved, i'll let that for the dev.
10 Dec 2012, 15:58 PM
#2
avatar of hicksi
Admin Black Badge

Posts: 983 | Subs: 3

indeed, thanks. replaced.

need to clean up the js code anyway, its a bit of a mess.
11 Dec 2012, 18:46 PM
#3
avatar of JAnx
Coder Red Badge

Posts: 487 | Subs: 1

Hicksi, i'm going to paste here new snippet. I added stop() method from jQuery library to make show/hide spamming better. I also improved a selector, but it needs a new class in the html.

To the div with the class "offwhite_box" add a new class offline_streams (div which is parent of the table with the class "offline").

Code
<div class="offwhite_box offline_streams"></div>


Then replace previous line with the new one.

Code
$('#livestream_view_list').find('.offline_streams').stop().animate({height:'toggle',opacity:'toggle'},'slow');
12 Dec 2012, 15:16 PM
#4
avatar of hicksi
Admin Black Badge

Posts: 983 | Subs: 3

merci :wub:. replaced.
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

729 users are online: 729 guests
2 posts in the last 24h
8 posts in the last week
40 posts in the last month
Registered members: 49069
Welcome our newest member, octavia15
Most online: 2043 users on 29 Oct 2023, 01:04 AM