o2xs spoiler

Gestart doorAntonn4 reacties33 weergaven

5 berichten · pagina 1 van 1

Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik mag van Lennard de spoiler van one2xs gebruiken voor mijn eigen site indien ik die een beetje aanpas. Maar hij is zo ingewikkeld dat ik hem niet vind. Iemand die die voor mij kan zoeken, en geven?

Thanks smile
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
function togglespoiler(id)
{
    $("#" + id).slideToggle(slow, function() {
        $("#button-" + id).val(    $("#button-" + id).val() == Laat inhoud zien ? Verberg inhoud : Laat inhoud zien);
    });
}


Dat is de JS code.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] spoiler[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"(([spoiler=(.+?)](.+?)[/spoiler])|([spoiler](.+?)[/spoiler]))is"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700])) {[/COLOR]
            [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"([spoiler=(.+?)](.+?)[/spoiler])is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]<fieldset><legend> <strong>Spoiler: $1 (<a href="javascript:void(0);" onclick="$(this).parent().parent().parent().children(div.in).animate({height: toggle, opacity: toggle}, 500);">open/sluit</a>)</strong> </legend><div style="display: none;" class="in">$2</div></fieldset>[/COLOR] [COLOR= #007700],[/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);[/COLOR]
            [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"([spoiler](.+?)[/spoiler])is"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]<fieldset><legend> <strong>Spoiler (<a href="javascript:void(0);" onclick="$(this).parent().parent().parent().children(div.in).animate({height: toggle, opacity: toggle}, 500);">open/sluit</a>)</strong> </legend><div style="display: none;" class="in">$1</div></fieldset>[/COLOR] [COLOR= #007700],[/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]); 
        }[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Als php code (functie)

© Bas Milius
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thanks voor (snelle) reacties. Er stonden meer spoiler dingen in de js dus was nogal ingewikkelt omdat dat ook men beste taal niet is. Ik test ze morgen smile
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren