Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS how to have a button over an image which when click expands to the left to show more info.

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #43574
    locka
    Member

    Guys I’m in the process of design a web site for my photography via wordpress. however I need some css help

    I currently have photos that when I hover over them the title slides up from the bottom this works great. However I now wish to create a small purchase button in top right. I wish the button to expand to the left when clicked to then show button and drop down box these are already working via plugin and I can display those easily enough once the code is sorted

    I just need some help on how to get the image to appear at the top right of the photo and then expand to the left. so in a similar position to how the close button is on normal jquery popup.

    I would show my code but There is a lot of it most related to wordpress plugin I’m using for the gallery (Nexgen).

    #129284
    locka
    Member

    Can’t see how I edit my message I forgot to say Id like to keep this just to CSS please if possible

    #129293
    Alen
    Participant

    You can create [CodePen](http://codepen.io/pen/) with generated HTML and CSS.

    #129439
    locka
    Member

    not sure codepen will help since it php css however ill try and post the code on here and highlight the important bits

    #129442
    Paulie_D
    Member

    Shouldn’t be too difficult with a pseudo element. I’m on my phone right now but will take a look when I can.

    #129441
    locka
    Member

    here is the php code this basically creates a gallery. Now the section highlighted is where the image title comes up. This is hidden and then brought up to rest at the bottom of the image via CSS. This great however it comes up when you hover over the image fine however in top right I’d like to purchase button which expands towards the left when clicked revealing dropdown box and purchase button. This code is stored with in image description on wordpress nexgen application and works fine. I wish to work out how to via CSS do

    1) Allow the button in the top right to work with out the image title being brought up at the same time. allow the rest of the image to active the title when hovered
    2) produce a button top right which expands left or brings up a popup in the middle if latter is not possible

    /**
    Template Page for the gallery overview
    Follow variables are useable :
    $gallery : Contain all about the gallery
    $images : Contain all images, path, title
    $pagination : Contain the pagination content

    You can check the content when you insert the tag
    If you would like to show the timestamp of the image ,you can use
    **/
    ?>

    show_piclens) { ?>


    caption ?>

    hidden ) continue; ?>
    columns > 0 && ++$i % $gallery->columns == 0 ) { ?>



==================================================================================
The CSS code is as follows the I caption class currently brings up the title and figure call is related to the image the rest of the CSS is the layout of the gallery and class to highlighting an image on hover. This has been customised from Nextgen set-up so most of this and PHP is not my original code

.ngg-spacing {
float: left;
margin-bottom: 20px;
margin-right: 20px;
}

.ngg-gallery-thumbnail {
float: left;
border-color:#DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204);
border-style:solid;
border-width:1px;
color:inherit;
margin: 0px;
padding: 10px;
float: left;
}

.ngg-gallery-thumbnail img {
filter: alpha(opacity=100);
-moz-opacity: .99;
opacity: .99;
border-color:#000000;
border-style:solid;
border-width:0px;
color:inherit;
vertical-align:top;
background-color: #FF0000;
}

.ngg-gallery-thumbnail:hover {
border-color:#000000;
}

.ngg-gallery-thumbnail img:hover {
filter: alpha(opacity=90);
-moz-opacity: .9;
opacity: .9;
border-color:#000000;
}

.ngg-gallery-thumbnail-box {
display: inline;
}

#figure {
display: block;
position: relative;
float: left;
overflow: hidden;
margin:0px !important;

}

#figure:hover {
opacity: 1;
}

#figure .Icaption {
position: absolute;
background: white;
background: rgba(255,255,255,0.75);
color: black;
opacity: 0;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
filter: alpha(opacity = 75);
bottom: -30%;
width: 270px;
height: 22px;
padding-top: 5px;
padding-left: 5px;
padding-right: 5px;
padding-bottom:5px;
}

#figure:hover .Icaption {
width: 270px;
height: 22px;
opacity: 1;
bottom: 0px;
}

============================================
Hope this helps

Paulie_D
Member

PHP doesn’t help.

#129436
locka
Member

ok what do you need in stead since this combined with the CSS is what generates the page with in wordpress

#129447
Paulie_D
Member

We need the HTML and CSS relating to the figure, caption and image effect. A reduced case in Code pen would be ideal.

Otherwise I can do a small example based on what I can see.

#129449
locka
Member

paulie_d small example would help as might be getting my code muddled and what I’ve manged so far is by no means how id like it.

Currently I’ve managed to get an what I need to slide out from the left kinda (wrong place but that’s a starting point) but at the same time the title of the image comes from the bottom. I’m wondering if I need to use Z-index and have them in this order

1) Image

2)Title

3) Purchase Button

would I then be write in thinking that area where purchase button is would take precedent, then the rest of the image area would active the title?

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘CSS’ is closed to new topics and replies.