הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   איך אפשר ב JS שקישור ילחץ לבד? (https://hosts.co.il/forums/showthread.php?t=105182)

dabi 18-09-13 16:31

איך אפשר ב JS שקישור ילחץ לבד?
 
אהלן
יש לי טופס פשוט שמוסיף ערכים למסד
אני רוצה שאחרי שהטופס נשלח יפתח פופ אפ שיציג לו את כל הערכים במסד
אז ראיתי את הפופ אפ הזה
http://www.jacklmoore.com/colorbox/example4/

אני משתמש ב Inline HTML
איך אני עושה מה שאני צריך? איך שזה עכשיו צריך ללוץ על הקישור בשביל שהפופ אפ יפתח....
אני רוצה שאוטומטי ישר אחרי שהטופס נשלח יפתח הפופ אפ
השורת קוד שבעצם עליה לוחצים היא
PHP קוד:

        <p><class='inline' href="#inline_content">Inline HTML</a></p

והיא פותחת את

PHP קוד:

        <div style='display:none'>
            <
div id='inline_content' style='padding:10px; background:#fff;'>
            <
p><strong>This content comes from a hidden element on this page.</strong></p>
            <
p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
            <
p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click meit will be preserved!</a></p>
            
            <
p><strong>If you try to open a new Colorbox while it is already openit will update itself with the new content.</strong></p>
            <
p>Updating Content Example:<br />
            <
class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
            </
div>
        </
div

תודה

Liorl 18-09-13 17:51

אתה צריך להשתמש בפונקציה trigger

קוד:

$( selector ).trigger( option );
לצורך הקוד ששלחת:
קוד:

$(".inline").trigger("click");
למרות שאני מאמין שיש API ל LIGHTBOX הזה. ואפשר לגרום לו להפתח דרך ה API


כל הזמנים הם GMT +2. הזמן כעת הוא 08:33.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ