One cool photo gallery

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard

    #1

    One cool photo gallery



    This is by far the most unique galleries I've seen yet.
    After seeing this, I know my idea can come together.




  • Richard Cornford

    #2
    Re: One cool photo gallery

    Richard wrote:[color=blue]
    > http://www.chunkysoup.net/advanced/o...edgallery.html
    >
    > This is by far the most unique galleries I've seen yet.
    > After seeing this, I know my idea can come together.[/color]

    Code that spews out script errors as a page loads is really not that
    unique.

    Richard.


    Comment

    • Richard

      #3
      Re: One cool photo gallery

      On Mon, 17 Jan 2005 07:27:26 -0000 Richard Cornford wrote:
      [color=blue]
      > Richard wrote:[color=green]
      >> http://www.chunkysoup.net/advanced/o...edgallery.html[/color][/color]
      [color=blue][color=green]
      >> This is by far the most unique galleries I've seen yet.
      >> After seeing this, I know my idea can come together.[/color][/color]
      [color=blue]
      > Code that spews out script errors as a page loads is really not that
      > unique.[/color]
      [color=blue]
      > Richard.[/color]


      What browser are you using that does this?
      The page validates 100%.
      Let me guess, you're using IE 3.0 right?


      Comment

      • Nik Coughin

        #4
        Re: One cool photo gallery

        Richard wrote:[color=blue]
        > On Mon, 17 Jan 2005 07:27:26 -0000 Richard Cornford wrote:
        >[color=green]
        >> Richard wrote:[color=darkred]
        >>> http://www.chunkysoup.net/advanced/o...edgallery.html[/color][/color]
        >[color=green][color=darkred]
        >>> This is by far the most unique galleries I've seen yet.
        >>> After seeing this, I know my idea can come together.[/color][/color]
        >[color=green]
        >> Code that spews out script errors as a page loads is really not that
        >> unique.[/color]
        >[color=green]
        >> Richard.[/color]
        >
        >
        > What browser are you using that does this?
        > The page validates 100%.
        > Let me guess, you're using IE 3.0 right?[/color]

        Richard,



        Look at the JavaScript in the source. Then click the validate link.


        Comment

        • Grant Wagner

          #5
          Re: One cool photo gallery

          "Richard" <Anonymous@127. 001> wrote in message
          news:csfj4h02qc k@news3.newsguy .com...[color=blue]
          > http://www.chunkysoup.net/advanced/o...edgallery.html
          >
          > This is by far the most unique galleries I've seen yet.
          > After seeing this, I know my idea can come together.[/color]

          You're polluting the global namespace by defining your "JavaScript
          object" "methods" outside the "class".

          // object constructor
          function csnPhotoObject( thumbID,thumbOf fURI,thumbOnURI ,fullID,fullURI ) {
          // code snipped
          // attach object's methods
          this.showThumb = csnPhotoObjectS howThumb;
          this.hideThumb = csnPhotoObjectH ideThumb;
          this.showFull = csnPhotoObjectS howFull;
          }
          // define object's methods
          // ALL THESE METHOD NAMES ARE IN THE GLOBAL
          // NAMESPACE AND COULD BE OVERWRITTEN BY
          // ANOTHER LIBRARY OF CODE. THEY CAN ALSO
          // BE CALLED DIRECTLY, WHERE REFERENCES TO
          // -this- IN THEM WOULD REFER TO THE GLOBAL
          // OBJECT, PROBABLY NOT WHAT YOU INTENDED
          function csnPhotoObjectS howThumb() { /* code snipped */ }
          function csnPhotoObjectH ideThumb() { /* code snipped */ }
          function csnPhotoObjectS howFull() { /* code snipped */ }

          Perhaps what you wanted is:

          function MyObject(...par ams...) {
          var param1 = param1;
          var param2 = param2;
          this.method1 = function() { /* code */ }
          this.method2 = function() { /* code */ }
          }
          --- OR ---
          function MyObject(...par ams...) {
          this.param1 = param1;
          this.param2 = param2;
          }
          MyObject.protot ype.method1 = function() { /* code */ }
          MyObject.protot ype.method2 = function() { /* code */ }

          At least with the above examples, I've encapsulated the "methods" that
          belong to the "class" within the "class" and reduced polluting the
          global namespace with all those functions. It also makes it much harder
          for another library of code or JavaScript author to trample all over my
          code.

          --
          Grant Wagner <gwagner@agrico reunited.com>
          comp.lang.javas cript FAQ - http://jibbering.com/faq


          Comment

          Working...