javascript - Using twitter bootstrap modal to create a gallery with images/content -


This is what I am trying to do, but I do not know how I have seen the gallery plugins and the module Has merged with the carousel, but no one can do what I want to do.

I have a grid of thumbnails on my site which, at the click, I want to open a standard bootstrap model. Once the modal is open, I want the ability to link to the content from the next item, so that you can round through the items in the gallery / grid by clicking Next / previous to close / reopen the modes without re-opening.

I do not have the code to show you at this point but this plugin is close to what I want to do:

Except I do not want it to open the full browser width / height , And it will behave more like standard bootstrap modal. Also, the bootstrap model separates me all and instead of keeping the image in the form of content, gives a little more control over the content of the model.

Any thoughts? HELP appreciated.

You can:

Thumbnail:

  & lt; Div id = "thumbHolder" & gt; & Lt; Img class = "thumb" src = "thumbnail.jpg" data-src = "bigImage.jpg" & gt; & Lt; Img class = "thumb" src = "thumbnail2.jpg" data-src = "bigger image 2.jpg" & gt; & Lt; Img class = "thumb" src = "thumbnail3.jpg" data-src = "bigger image 3.jpg" & gt; & Lt; / Div & gt;   

Popup Styles:

  #popUp {width: 500px; Height: 500px; Status: Completed; Top: 0; Correct: 0; Bottom: 0; Left: 0; Margins: Auto; Background: #ffffff; display none; }   

Popup HTML

  & lt; Div id = "popup" & gt; & Lt; Img class = "popImg" src = "" & gt; & Lt; Button class = "prev" & gt; Previous & lt; / Button & gt; & Lt; Button class = "next" & gt; Next & lt; / Button & gt; & Lt; / Div & gt;   

jQuery

  var index = 0; Var imageCount = $ ('.thumb') Length $ (document) .ready (function () {$ ('. Thumb'). Click (function () {index = $ ('.thumb'). Index ($ $ ('. PopImg'). Attr ('src', src); $ ('# popup'). FadeIn () (var) = $ (this)); var src = $ (this) .attr ('data -src '); $ ('. (Index & lt; imageCount) {index + = 1;} var nextElement = $ ('. Thumbs') [$ ('.')]; $ ('. Next') Click (Function (e) {e.preventDefault (); ARTR ('src', src);}) $ $ ('prev'). Click ('. Function (e) {e.preventDefault (); if ( Index = 1;} var nextElement = $ ('thumb') [index]; var src = $ (next element) .attr ('data-src'); $ ('.popImg '). Attr (' src ', src);});});    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -