Announcement

Collapse
No announcement yet.

YUI onload?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ville
    started a topic [Forum] YUI onload?

    YUI onload?

    Is there a way to somehow access YUI onload functionality?

    I'm using embed.ly to auto-embed various media types on the forums, and for it to work I need to include embed.ly code in the header. That's no problem, but then I'd need to initialize embed.ly when the page has been loaded.

    Currently I'm doing it with jQuery by adding the following in the end of headinclude template:

    Code:
    <!-- BEGIN CUSTOMIZED -->
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
    <script src="http://scripts.embed.ly/jquery.embedly.min.js"></script>
    <script type="text/javascript">
    <!--
       $('document').ready(function(){
          $('div').embedly({
             maxWidth: 400,
             maxHeight: 200,
             method: 'replace',
             wrapElement: 'div',
             className: 'embed',
             addImageStyles: true,
             cssSelector: 'a'
          });
       });
    // -->
    </script>
    <!-- END CUSTOMIZED -->
    But since this is the only thing I'm using jQuery for and since YUI is used anyway, perhaps there would be a way to use YUI's onload functionality instead?

    Thanks for any insights on this!

Related Topics

Collapse

  • Hectorsky
    like widghet
    by Hectorsky
    Hello , i have a problem with a little widget .

    I want to put this code Like widget to be next Google , But this code is going down

    code:
    PHP Code:
    <!-- Put this script tag to 
    ...
    Fri 18 Dec '15, 6:42am
Working...
X