SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    The Jellophonic Autobrain CHeeSeBLiND's Avatar
    Join Date
    Jul 2001
    Location
    Bolton, England
    Posts
    584
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Second object not initialising

    I'm using prototype. I'm still new to it so apologies if I've made a schoolboy error.

    http://www.popmong.com/template.html

    If you click on the share link in the first post it works as it should do. But if you try the second one it doesn't work at all.

    http://www.popmong.com/js/articles.js is the javascript for the page.

    Cheers.
    hmm...

  2. #2
    The Jellophonic Autobrain CHeeSeBLiND's Avatar
    Join Date
    Jul 2001
    Location
    Bolton, England
    Posts
    584
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been playing around and for some reason the loop isn't working as it should.

    Code:
    function articlesInit()
    {
        var elems = document.getElementsByClassName('share');
    
        for (i = 0; i < elems.length; i++)
        {
            var panels = [];
            var shareLink = elems[i];
            var articleDiv = ascendDom(shareLink, 'div');
    
            panels[i] = new SharePanel(articleDiv.id);        
        }
    }
    hmm...

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    This is a javascript forum, and prototype is a proprietary framework that uses javascript. Since prototype is like its own language, unless someone here knows prototype, you won't get an answer. Most people here are familiar with pure javascript.

    You might want to try finding a forum that deals specifically with prototype. Good luck.

  4. #4
    SitePoint Addict Mirek Komárek's Avatar
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you try instead of this
    panels[i] = new SharePanel(articleDiv.id);
    something like
    panels[i].onclick =function(){ SharePanel(this.parentNode.parentNode);}

    But as already 7stud said it is too complicated too get orientation in that library


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •