Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Czy mozna zamienic click na load?
drtom
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.10.2009

Ostrzeżenie: (0%)
-----


Witam,
Mam pytanie co do funkcji, nie znam sie na javascript wogole i niewiem jak zamienic cos takiego.

Kod
function copyIntoClipboard(text) {

                        var flashId = 'flashId-HKxmj5';

                        /* Replace this with your clipboard.swf location */
                        var clipboardSWF = 'images/clipboard.swf';

                        if(!document.getElementById(flashId)) {
                            var div = document.createElement('div');
                            div.id = flashId;
                            document.body.appendChild(div);
                        }
                        document.getElementById(flashId).innerHTML = '';
                        var content = '<embed src="' +
                            clipboardSWF +
                            '" FlashVars="clipboard=' + encodeURIComponent(text) +
                            '" width="0" height="0" type="application/x-shockwave-flash"><\/embed>';
                        document.getElementById(flashId).innerHTML = content;
                    }

                $(document).ready(function(){
                    $("#clipboard-copy").bind("click", function() {
                        copyIntoClipboard($("#aaaa").html());
                        $("#paste-area").val("");
                        
                    });
                    $("#clipboard-copy-2-button").bind("click", function() {
                        copyIntoClipboard($("#clipboard-copy-2-source").html());
                        $("#paste-area").val("");
                    });
                });


W tej czesci kodu $("#clipboard-copy").bind("click", function() {
jest cos takiego ze po kliknieciu kopiuje sie tresc, a czy mozna zrobic tak ze po zaladowaniu strony tresc automatycznie sie skopiuje bez klikania w przycisk?

Dziekuje i pozdrawiam.
Go to the top of the page
+Quote Post
Blame
post
Post #2





Grupa: Zarejestrowani
Postów: 678
Pomógł: 124
Dołączył: 26.09.2009

Ostrzeżenie: (0%)
-----


Hmm... też się nie znam za dobrze wstydnis.gif ale może po prostu "click" zamienić na "onload". Spróbuj może za działa.


--------------------
Go to the top of the page
+Quote Post
drtom
post
Post #3





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.10.2009

Ostrzeżenie: (0%)
-----


Dzieki Blame, ale tak juz probowalem, tzn wpisywalem onload, load i wtedy wogole nie dziala :/
Go to the top of the page
+Quote Post
seth-kk
post
Post #4





Grupa: Zarejestrowani
Postów: 444
Pomógł: 79
Dołączył: 26.05.2009

Ostrzeżenie: (0%)
-----


na oko za pozno przypisujesz zdarzenie - gdy dokument jest gotowy wszystkie elementy juz sa zaladowane


--------------------
Go to the top of the page
+Quote Post
vokiel
post
Post #5





Grupa: Zarejestrowani
Postów: 2 592
Pomógł: 445
Dołączył: 12.03.2007

Ostrzeżenie: (0%)
-----


trigger


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 20:25