Results 1 to 5 of 5

Thread: Remove Border Image On One Gallery

  1. #1
    Join Date
    Nov 2004
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Remove Border Image On One Gallery

    1) Script Title: Photo Album script v2.0

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem:

    I am using the above script for a few different galleries. On one gallery I would like to keep the image border, but on another gallery I would like to remove the border. How can I do this? This is the code for the border in the css:

    /*CSS for images within an album*/
    .photogallery img{
    border: 1px solid #393838;
    }

    Thank you.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In addition to the photogallery class, which applies to all galleries made with this script, each individual gallery also has the id:

    photogallery-x

    where x is a number from 1 to however many galleries you have on the page. So to set a unique border (none in this case) for just the second gallery:

    Code:
    #photogallery-2 img {
    border: none;!important;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2004
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Please bear with me.

    I see the id using firebug, but where in the code do I add -x the number? Please note that I only have one gallery per page.

    Thanks!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    With only one gallery per page:

    Code:
    .photogallery img {
    border: none;!important;
    }
    will do nicely. Just make sure to only apply that style to the page(s) where you want no border.

    Like say you have a stylesheet that all the pages use. It can have:

    Code:
    .photogallery img { 
    border: 1px solid #393838;
    }
    But then in a separate stylesheet used only by the page(s) where you want no border, have:

    Code:
    .photogallery img {
    border: none;!important;
    }
    Styles cascade, so all pages may have the sheet with the border: 1px solid #393838;. The !important keyword will override it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Nov 2004
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry to bother you again, but I'm using Joomla to build the site and it allows you to link to the css file via the index.php for all the pages. So, is there a way I can add the code directly to the js code or around the images in the js file to remove the border. If it's not possible then I'll just live with it.

    Here is the code. Thanks!

    -----------------------------------------------

    <script type="text/javascript">

    //Define your own array to hold the photo album images
    //Syntax: ["path_to_thumbnail", "opt_image_title", "opt_destinationurl", "opt_linktarget"]

    var myportfolioLOGOS=new Array()
    myportfolioLOGOS[0]=["../lirva/portfolio/logos/OSP.jpg", "", ""]
    myportfolioLOGOS[1]=["../lirva/portfolio/logos/YorkAngels.jpg", "", ""]
    myportfolioLOGOS[2]=["../lirva/portfolio/logos/WIBC.jpg", "", ""]
    myportfolioLOGOS[3]=["../lirva/portfolio/logos/Troy.jpg", "", ""]

    //initiate a photo gallery
    //Syntax: new photogallery(imagearray, cols, rows, tablewidth, tableheight, opt_[paginatetext_prefix, paginatetext_linkprefix])
    var thepics=new photogallery(myportfolioLOGOS, 3, 3, '680px', '300px')

    //OPTIONAL: Run custom code when an image is clicked on, via "onselectphoto"
    //DELETE everything below to disable
    //Syntax: function(img, link){}, whereby img points to the image object of the image, and link, its link object, if defined
    thepics.onselectphoto=function(img, link){
    if (link!=null) //if this image is hyperlinked
    window.open(link.href, "", "width=800, height=600, status=1, resizable=1")
    return false //cancel default action when clicking on image, by returning false instead of true
    }

    </script>

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
  •