control Icon image not displayed on swipebox

Discussion in 'Scripts' started by henrikjt, Feb 10, 2014.

to remove all ads.
  1. henrikjt

    henrikjt New Member

    Messages:
    63
    Hi All,

    I cant figure out why the control icons are not being displayed when the image is enlarged.

    The control icons are located on the icons.png image.

    Please scroll down to the photo gallery to see for yourself.

    On this site that has the same files on the server it is displayed correctly:

    http://realimg.com/joinysc/

    however, on the site which is hosted on another server with another company the control icons are not displayed.

    http://joinysc.ysc.org/

    here is the code:

    #swipebox-action #swipebox-prev, #swipebox-action #swipebox-next,
    #swipebox-action #swipebox-close {
    background-image: url("../images/icons.png");
    background-repeat: no-repeat;
    border: none!important;
    text-decoration: none!important;
    cursor: pointer;
    position: absolute;
    width: 50px;
    height: 50px;
    top: 0;
    }
     
  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,668
    Your code has a relative URL with a directory qualifier (..) which means they HAVE to be in the same physical location as the document is being served from.
     
  3. henrikjt

    henrikjt New Member

    Messages:
    63
    The image file is uploaded on both servers. Not sure if you are referring to something else?
     
  4. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,668
    Is it in EXACTLY the same location, and is directory traversal above root allowed on both servers.

    ../ means the directory ABOVE the web root directory has to be accessible to the site user account.
     
  5. henrikjt

    henrikjt New Member

    Messages:
    63
    Yep, the image is located in the same location. I uploaded the files from the same folder to each server after i found out there was a problem. I have no clue if directory traversal above root is allowed on both servers. How would i find out about that?

    I appreciate the help!
     
  6. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,668
    You need to check the permissions on directories above the webroot in whatever control panel your hosting uses, or a shell session, assuming *nix server and shell access is allowed.

    If it is a shared hosting account, competent shared server admins (should) turn off "parent directory access" to prevent directory traversal attacks from rogue or malicious scripting.
     
  7. henrikjt

    henrikjt New Member

    Messages:
    63
    I figured it out. I had to add !important to the css code

    background-image: url("../images/icons.png")!important;
     
  8. ronaldroe

    ronaldroe Super Moderator Staff Member

    Messages:
    1,223
    If you had to add that, you messed up somewhere else. Your selector may not be specific enough.
     

Share This Page