Using the PopUp Pattern

Here, we use our PopUp pattern, the code for which is within ssPopUp.js.

The following files need including in the head of the document...


    <script src="../Include/Core.js" type="text/javascript"></script>
    <script src="../Include/ssPopUp.js" type="text/javascript"></script>
    

For any hyperlink with the class "popup", it opens the href of that hyperlink in a 640x480 popup window.


    <a class="popup" href="Player.asp?intPlayerID=1">1. Joe Hart (England)</a>
    

Additionally, specifying a width and height in the rel attribute will use this values as the dimensions of the popup. The width and height need to be between 100 and 999.


    <a class="popup" href="Player.asp?intPlayerID=2" rel="width:400;height:200;" >2. Micah Richards (England)</a>
    
  • Note that the line ssAddLoadEvent(ssInitialisePopUp); is run automatically in ssPopUp.js. This looks for hyperlinks of class popup and attaches the popup behaviour to them.
  • It is possible to invoke a popup manually by running ssPopUp(), passing in the URL as the parameter (it will open a 640x480 popup window).
    
        ssPopUp("Player.asp?intPlayerID=9");