Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Open jwbox on page load

4 replies [Last post]
Reply

Is there a method that I can call that will automatically open the jwbox on page load?

Reply

Come on guys... I really need some help on this one.

If there's no function is there a hack or work around that would accomplish the same functionality?

Reply

Unfortunately not - JW Box wasn't designed to be open on startup. You can always modify the source code (http://www.longtailvideo.com/jw/js/jquery.jwbox.js) to work however you like.

Reply

Yes there is.

<body onLoad="$.jwbox.toggle();$('.jwbox_content').jwbox.toggle(); return false;">

It will open the movie from jwbox_content. So you have that on the page.

Make sure you disable this on all other pages

Reply

Although the above practice(s) still work, they have fallen out of favor.
The standard of unobtrusive JavaScript dictates that not only should JavaScript be removed from the document structure (i.e., not use HTML event handler attributes) but should also not obtrude on (have to commingle with) other code.

A much better and effective method is to use the AddLoadEvent Functions

This is a much better approach

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options