View RSS Feed

Post a JavaScript

Custom, non DD related JavaScripts from other members.

  1. [jQuery-append] includes HTML as well as JS

    1.
    Create a string that is the JS-equivant of the DD Anylink standalone menu (or of any standalone menu) with the help of a good HTML-to-JS-converter. Make sure that all JS and CSS are made inline before conversion. Name the string included_js.
    2.
    Create a script like this:
    Code:
    <script>
    var included_js = STRING, where STRING represents the string you just created.
    </script>
    (in the Anylink-case, STRING representsw THIS) and put the script ...

    Updated 08-20-2012 at 12:26 AM by molendijk (Correction)

    Categories
    Post a JavaScript
  2. Force a page to open in a new tab

    There's an increasing number of sites that refuse to be opened in a new window. For instance, the following doesn't work (anymore):
    Code:
    <a href="javascript: void(0)" onclick="window.open('http://google.com'">open Google in new (traditional) window</a>
    In those cases, you can use the following to open the sites in a new tab:
    Code:
    <a href="javascript: void(0)" onclick="window.open('','_new').location.href='http://google.com'">open
    ...
    Categories
    Post a JavaScript
  3. Replacing iframe attributes with javascript (HTML5)

    I was working the other day on a script for setting the height of an iframe to match the height of its content and noticed that under certain circumstances the iframe gets its scroll bars 'back' when it shouldn't. This happens mainly when the iframe is given a very small width. Overflow: hidden solves the problem in Firefox (most of the time), but not in IE. This browsers needs scrolling="no", which also works in non-IE. However, attributes like scrolling="no" and frameborder="no" ...

    Updated 01-12-2012 at 10:36 AM by molendijk (Corrections in text)

    Categories
    Post a JavaScript
  4. HTML 4.01 Strict Video Include & Chopping Parts from YouTube video's

    Perhaps many of you already knew this. I didn't.
    HTML 4.01 Strict Video Include:
    Code:
    <!--[if IE]>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="position:absolute;left:20%; top:20%; height:80%;width:80%">
    <![endif]-->
    <!--[if !IE]><!-->
    <object type="application/x-shockwave-flash" style="position:absolute;left:20%; top:20%; height:80%;width:80%" data="http://swf.tubechop.com/tubechop.swf?vurl=rw1j0NsIIeE&amp;start=164&amp;end=199&amp;cid=28051"
    ...

    Updated 10-02-2009 at 01:29 PM by molendijk (Observation made by jscheuer about title)

    Tags: add, michal Add / Edit Tags
    Categories
    Post a JavaScript , Flash related
  5. YouTube Chromeless Player

    It's not directly obvious from this how we can:
    - start a movie on page load (question asked by some people on different forums);
    - specify the dimensions and position of the movies in percentages;
    - make good use of the ytplayer functions.

    Autoplay: something like
    Code:
    function so_start()
    {
    loadNewVideo('lKq9_kk3Zbc', 20);
    }
    //IE needs some time
    window.onload=setTimeout('so_start()',2000)
    Size of movie in percentages ...

    Updated 08-29-2009 at 01:59 PM by molendijk

    Categories
    Post a JavaScript , Flash related
Page 1 of 2 12 LastLast