ebay style gallery issue - html

So I need help if this is even possible, going to try to be as detailed as possible so you guys understand my problem. I found a simple ebay style gallery code that I want to incorporate into my website i'm making. heres the code
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width: 400px; vertical-align: top;">
<img src="1_large.jpg" width="398" height="299" alt="Large Photo" style="border: 1px solid #000000;" name="swap">
</td>
<td style="width: 6px;"></td>
<td style="width: 94px; vertical-align: top;">
<img src="1_small.jpg" width="92" height="69" alt="Small Photo" style="border: 1px solid #000000; margin-bottom: 3px;" onmousedown="document.swap.src='1_large.jpg';">
<br>
<img src="2_small.jpg" width="92" height="69" alt="Small Photo" style="border: 1px solid #000000; margin-bottom: 3px;" onmousedown="document.swap.src='2_large.jpg';">
<br>
<img src="3_small.jpg" width="92" height="69" alt="Small Photo" style="border: 1px solid #000000; margin-bottom: 3px;" onmousedown="document.swap.src='3_large.jpg';">
</td>
</tr>
</table>
I also have a slimbox2 addon into my site, link is here if anyone doesnt know what that is. slimbox2
so all i need to do is add this
<a href="images/1_large.jpg" rel="lightbox"><img src=........./>
to allow the image to expand into a larger preview using slimbox, my problem is, if i add it to main image that says "1_large.jpg" the href link is still linked to that specific image, regardless if I "swap" it when i click on another image
for example, i have 3 images in the gallery. the first image is already loaded into the big preview of the ebay style gallery, when i click on image 3, it gets swapped out to the big preview of the ebay style, now i want to expand it and see the image a lot bigger (this is where slimbox comes in) but once i click the big preview, the image gets expanded, but image 1 gets loaded, not image 3.
hopefully i made the problem clear, if anyone can help that would be fantastic!
all in all, im looking for a photo gallery similar to neweggs website for viewing products

Is this the functionality you're looking for? - FIDDLE
HTML
<div class='bigpic'></div>
<div class='rightbar'>
<div class='littlepic'><img src='http://img4.wikia.nocookie.net/__cb20130310121325/youtubepoop/images/c/c0/Goofy_Yop.jpg' /></div>
<div class='littlepic'>
<img src='http://img4.wikia.nocookie.net/__cb20130706024933/disney/images/8/88/Mickey-Mouse-High-Resolution-Wallpapers.stillmaza.com-1.jpg' /></div>
<div class='littlepic'><img src='http://images.wikia.com/disney/images/archive/7/71/20121205062928!Donald-duck-disney-photo-450x400-dcp-cpna013154.jpg' /></div>
</div>
CSS
.bigpic {
float: left;
width: 400px;
height: 300px;
border: 1px solid black;
overflow: hidden;
}
.bigpic img {
width: 400px;
height: 300px;
}
.rightbar {
float: left;
width: 110px;
margin-left: 5px;
}
.littlepic {
width: 100px;
height: 80px;
border: 1px solid black;
margin-bottom: 5px;
overflow: hidden;
}
.littlepic img {
width: 100%;
}
JS
$('.littlepic img').on('click', function(){
$('.bigpic').html('');
$(this).clone().appendTo('.bigpic');
});
Edit:
<script>
$(document).ready(function(){
$('.rightbar .littlepic:first-child img').clone().appendTo('.bigpic');
$('.littlepic img').on('click', function(){
$('.bigpic').html('');
$(this).clone().appendTo('.bigpic');
});//end click
});//end ready
</script>
</body>
</html>

Related

Remove white border around object tag

I'm currently looking for a way to remove a thin white border around the object tag... heres the code and what I have tried
.hr-ob {
background-color: #003262;
width: 50px;
height: 10px;
border: none;
outline: none;
border-width: 0;
padding: 0;
margin: 0;
}
<div style="background-color: #000000;">
<object border="0" class="hr-ob" data="" type="image/jpg"></object>
</div>
Johnathan's solution was still flawed as I was still getting a border, nevertheless wanted to share the solution I am using now:
<iframe class="hr-ob" width="50" height="5" scrolling="no" frameborder="0"></iframe>
.hr-ob {
background-color: #003262;
width: 50px;
height: 5px;
}
Since you have mentioned the type as image/png and the data field is empty there seems to be a default internal-root-color that is appearing.
but when you place an image there is no border.
The border attribute of <object> is not supported in HTML5. Use CSS instead.
CSS syntax: <object style="border:0px">
.hr-ob {
background-color: #003262;
height:100px;
width:100px;
}
<div style="background-color: #000000;">
<object style="border:0px;" class="hr-ob" data="https://dummyimage.com/600x400/4550ed/fff" type="image/jpg"></object>
</div>
<div style="background-color: #000000;">
<object style="border:0px;" class="hr-ob" data="" type="image/jpg"></object>
</div>

Make a regular button look like slack

I have a button which when pressed revokes a user's access token. I want to make it look like the Sign in with Slack button.
I am attaching the html code for the Sign in with Slack Button below.
<a href="https://slack.com/oauth/authorize?scope=identity.basic,identity.email,identity.team,identity.avatar&client_id=373568302675.374024189699">
<img alt="Sign in with Slack" height="40" width="172" src="https://platform.slack-edge.com/img/sign_in_with_slack.png" srcset="https://platform.slack-edge.com/img/sign_in_with_slack.png 1x, https://platform.slack-edge.com/img/sign_in_with_slack#2x.png 2x"
/>
What do I need to do to make my button look the same?
For now, the code for my button is as under:
<input type="button" value="Unlink Slack" onclick="location.href='#Url.Action(" RevokeAuth ","Settings ")'"/>
Is this what you were looking for I added the input to a div with the slack image and added the onclick to the div as well as the button so the pointer looks correct.
<style>
.slk {
border: 1px solid #C8C8C8;
width: 170px;
width: 170px;
border-radius: 5px;
display: flex;
height: 35px;
cursor: pointer;
}
.slkInp {
color: #383838;
background-color: white;
border: none;
padding: none;
font-size: 15px;
font-weight: bold;
}
.slkInp:hover {
cursor: pointer;
}
</style>
<div class="slk" onclick="location.href='#Url.Action(" RevokeAuth ","Settings ")'">
<img alt="Unlink Slack" height="30" width="30" style="padding-left:10px;" src="https://pbs.twimg.com/profile_images/885554951857946624/sd7GRyjY_400x400.jpg" /><input class="slkInp" type="button" value="Unlink Slack" onclick="location.href='#Url.Action("
RevokeAuth ","Settings ")'"/></div>
<a href="https://slack.com/oauth/authorize?scope=identity.basic,identity.email,identity.team,identity.avatar&client_id=373568302675.374024189699">
<img alt="Sign in with Slack" height="40" width="172" src="https://platform.slack-edge.com/img/sign_in_with_slack.png" srcset="https://platform.slack-edge.com/img/sign_in_with_slack.png 1x, https://platform.slack-edge.com/img/sign_in_with_slack#2x.png 2x"
/>
First off, I can't ask for clarification in a comment because of the 50 reputation requirement. Fair enough.
What it seems like you're asking is how do you want to style a button to look like the Slack button, but with only HTML? All they are doing here is using an <img> tag to throw a button on the screen. If you want to copy this behavior exactly, grab an image editor and draw a rounded rectangle with 1px black border, throw your icon on the right and some text on the left then follow the slack design:
<a href="https://linkhere.link">
<img alt="Sign in with X" height="40" width="172" src="image.png" />
</a>
If you want to be able to have a button styled similarly with just HTML and CSS you can do that too, with your input:
input {
height: 40px;
width: 172px;
border: 1px solid gray;
border-radius: 5px;
background-color: white;
content: url(image.png);
...
}
Then add your own image and move the text and image to your liking.

Trying to get invisible hyperlink

My Code: https://jsfiddle.net/zL5b22bb/1/
Code 1. This is the original code showing the hyperlink border after you click on the image. It's clearly visible.
<a href="http://5645646/" target="_blank">
<img style="display:inline-block;background-color:#000000; width: 100px; height: 100px; cursor: pointer;border: 5px solid #0F16FD;"
onmouseover="this.src='http://i.imgur.com/ra4471G.png';
this.style.color='white'
this.style.border='5px solid #66A4F2'"
onmouseout="this.src='http://i.imgur.com/awwMlPD.png';
this.style.color='white'
this.style.border='5px solid #0F16FD' "
/></a>
Code 2. After I remove the "img tag" the the hyperlink border is not visible. Which is what I want. But, by removing "img tag", the onmouseover background image gets disabled which is what I don't want.
<a href="http://5645646/" target="_blank" style="display:inline-block;background-color:#000000; width: 100px; height: 100px; cursor: pointer;border: 5px solid #0F16FD;"
onmouseover="this.src='http://i.imgur.com/ra4471G.png';
this.style.color='white'
this.style.border='5px solid #66A4F2'"
onmouseout="this.src='http://i.imgur.com/awwMlPD.png';
this.style.color='white'
this.style.border='5px solid #0F16FD' "
/></a>
Code 3. Now the hyperlink is invisible after you click on it, but the borders double up onmouuseover which messes it all up.
<a href="http://5645646/" target="_blank" style="display:inline-block;background-color:#000000;color:white; width: 100px; height: 100px; cursor: pointer;border: 5px solid #0F16FD;">
<img src="http://i.imgur.com/awwMlPD.png" width="100px" height="100px"
onmouseover="this.src='http://i.imgur.com/ra4471G.png';
this.style.border='5px solid #66A4F2'"
onmouseout="this.src='http://i.imgur.com/awwMlPD.png';
this.style.border='5px solid #0F16FD' "
/>
Everything is in the jsfiddle link.
I'm trying to get it to where you can have 2 color borders while keeping the hyperlink invisible with onmouseover working.
Is there a less complicated method than doing this? https://jsfiddle.net/fcdy4ocw/4/
<a id="test" href="http://5645646/" target="_blank" style="color:white; display:inline-block;background:#000000 url(http://i.imgur.com/awwMlPD.png);width:100px;height:100px;cursor:pointer;border:5px solid #0F16FD;" onmouseover="this.style.border='5px solid #66A4F2';
this.style.background='#000000 url(http://i.imgur.com/ra4471G.png)';" onmouseout="this.style.border='5px solid #0F16FD';
this.style.background='#000000 url(http://i.imgur.com/awwMlPD.png)';"></a>

#id not selecting my image in CSS

I want to border an image, and when I code it in HTML, I get a border. But when I try it in CSS, the border will be placed south-west on my page, seperated from my image.
<img id="maxaboutme" />
<img src="C:\Users\M de Witte\Desktop\html\aboutme\maxpannenkoekenhuisHTML01.jpg"
height="300px" />
CSS
#maxaboutme{
border: solid grey;
border-width: 15px;
}
This is what happens :
Change your img tag as shown below :(In your case ,you had 2 of them which were not related to each other )
<img id="maxaboutme"
src="http://www.google.com/selfdrivingcar/images/home-where.jpg" height="300px" />
CSS :
#maxaboutme
{
border: solid grey;
border-width: 15px;
}
<img id="maxaboutme"
src="http://www.google.com/selfdrivingcar/images/home-where.jpg" height="300px" />
Fiddle Link
It should work like that. By the way I recommend you to use class instead of id ;)
#maxaboutme{
border: solid 15px grey;
height: 300px;
}
<img id="maxaboutme" src="C:\Users\M de Witte\Desktop\html\aboutme\maxpannenkoekenhuisHTML01.jpg" />
It's because you have added another image (<img id="maxaboutme" />) instead of applying the id to
<img src="C:\Users\M de Witte\Desktop\html\aboutme\maxpannenkoekenhuisHTML01.jpg" height="300px" />
Modify your HTML as below.
#maxaboutme {
border: solid grey;
border-width: 15px;
}
<img id="maxaboutme" src="C:\Users\M de Witte\Desktop\html\aboutme\maxpannenkoekenhuisHTML01.jpg" height="300px" />
Try This
CSS:
#maxaboutme{
border: solid grey;
border-width: 15px;
}
HTML:
<img id="maxaboutme" src="C:\Users\M de Witte\Desktop\html\aboutme\maxpannenkoekenhuisHTML01.jpg" height="300px" />
Pleae note: avoid using physical paths (C:\Users\M de Witte\Desktop\html\aboutme\maxpannenkoekenhuisHTML01.jpg) for your images because it will work on your computer only and it will not work for your client
html tag should be :
<img id="yourimage" src="http://placeit.org/300x300.jpg"/>
css :
#yourimage {
border: 1px solid gray;
height: 300px;
}
hope it would be helpful.
It's working. I had an extra IMG indeed.
I am still new and also learning from the paths.

Suggestion for gallery thumbnail on click?

I'm trying to build an image gallery with thumbnails and a display for a larger image. At present, its working when the the mouse hovers over the thumbnail which displays the larger image. However I wish to replace the hover feature with an on click so that the larger image does not disappear when the mouse leaves the thumbnail. From a bit of research I'm lead to believe that this can not be done with css as with the hover feature and that I would need to include some script. As I'm new to web development after this I'm a bit lost and would appreciate some help. Below is the html code for the gallery container and the corresponding css code......where do I start from here?
Thanks
A
html code
<div class="gallerycontainer">
<a class="thumbnail" href="#thumb"><img src="images/gallery/1one/101.jpg" width="56px" height="80px" border="0" /><span><img src="images/gallery/1one/101.jpg" width="405px" height="585px"/></span></a>
<a class="thumbnail" href="#thumb"><img src="images/gallery/1one/102.jpg" width="56px" height="80px" border="0" /><span><img src="images/gallery/1one/102.jpg" width="405px" height="585px"/></span></a>
<a class="thumbnail" href="#thumb"><img src="images/gallery/1one/103.jpg" width="56px" height="80px" border="0" /><span><img src="images/gallery/1one/103.jpg" width="405px" height="585px"/></span></a>
<a class="thumbnail" href="#thumb"><img src="images/gallery/1one/104.jpg" width="56px" height="80px"border="0" /><span><img src="images/gallery/1one/104.jpg" width="405px" height="585px"/></span></a>
<br />
</div>
css code
.gallerycontainer{
position: absolute;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
}
.thumbnail img{
border: 1px solid white;
margin: 0 5px 5px 0;
}
.thumbnail:hover{
background-color: transparent;
}
.thumbnail:hover img{
border: 1px solid grey;
}
.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: #000000;
padding: 5px;
left: -1000px;
border: none;
visibility: hidden;
color: black;
text-decoration: none;
}
.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}
.thumbnail:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: 0;
left: 300px; /*position where enlarged image should offset horizontally */
z-index: 50;
}
Heres a simple start with jquery.
http://jsfiddle.net/8GKXM/
$('.thumbnail').each(function(){
$(this).click(function() {
$('.thumbnail span').hide();
$(this).find('span').show('slow');
});
});
This is what the jquery says basically:
On every individual .thumbnail click:
hide .thumbnail span ( as in every span it finds )
then
find clicked .thumbnail's span and show that
I would probably move the bigger images into their own container though...
You can use jQuery along with blockUI plugin:
<div class="gallerycontainer">
<a class="thumbnail" href="#thumb" class="imgthumb"><img src="images/gallery
/1one/101.jpg" width="56px" height="80px" border="0" /></a>
<a class="thumbnail" href="#thumb" class="imgthumb"><img src="images/gallery
/1one/102.jpg" width="56px" height="80px" border="0" /></a>
</div>
And then you can use the window onload event to attach the onclick event to fire the large image with blockUI:
$(function(){
$(".imgthumb").onclick(function() {
$.blockUI({
message: "<div><img src=" + $(this + " > img").attr("src") + " width='405' height='585' /></div>";
css: { border: '1px solid grey'}
});
});
});