Results 1 to 8 of 8

Thread: Can someone translate this..

  1. #1
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Can someone translate this..

    function openPortfolio(section) {
    if(!_opened) openUp();
    _section = section;
    var image = arguments[1] || 0;
    var url = 'portfolio.php?image='+image+'&section='+section;
    ['Cars','Nature','Long Exposure','Food','About'].each(function(e){
    Element.removeClassName(e,'active');
    });
    Element.addClassName(section,'active');
    new Ajax.Request(url);
    }


    So I'm using someone else's script as a base to build my own but there that bolded line that I can't understand... where is it trying to retrieve in this case images from?

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    The JavaScript is accessing another file called portfolio.php and portfolio.php is accessing the images. You can't tell where the JavaScript code is accessing the images from because the actually thing that accesses the images is in a PHP file. You'd have to open this PHP file and see what it returns to the JavaScript.

  3. #3
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    ok as I suspected... here is the php in whole....

    PHP Code:
    var _timeout 0;

    function 
    updateImage() {
      if(!
    _show && !_imageloader.complete) {
        if(++
    _timeout == 50Effect.Appear('indicator',{duration:0.4,queue:'end'});
      }
      if(
    _imageloader.complete && !_show) {
        $(
    'content').innerHTML '';
        $(
    'info').innerHTML '1/0';
        $(
    'caption').innerHTML '';
        $(
    'main').style.backgroundImage 'url(/)';
        
    Effect.Appear('arrow-left');
        
    Effect.Appear('arrow-right');
        
    _currentImage 0;
        
    _nrOfImages 0;
        
    clearInterval(_timer);
        
    _timer null;
        
    _imageloader null;
        if(
    _timeout>49Effect.Fade('indicator',{duration:0.3,queue:'end'});
        
    _timeout 0;
        
    reveal();
      }
    }

    _section 'portfolio1';

    var 
    _imageloader = new Image();
    _imageloader.src '/';

    var 
    _timer setInterval(updateImage10);

    hide(); 

  4. #4
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    I don't think that's PHP... that code is JavaScript :/ - oh well, can you tell me which website's code you are using and the directory for the JavaScript that you borrowed?

  5. #5
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    this is what I'm currently referencing http://www.christofwagner.com/

  6. #6
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Aye. I see now. This .php file gave that JavaScript output. We can only know where it's accessing the images if you read the source of the .php file which is only possible if you own the site, or if you contact the site's owner. Sorry!

  7. #7
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    oo ok hmmm....

  8. #8
    Join Date
    Sep 2008
    Posts
    77
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    or would you happen to know what was contained within the php file? guesses?

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
  •