Code Monkey home page Code Monkey logo

diagonal-slider's Introduction

DiagonalSlider

jQuery plugin to create a Diagonal Slider.
The diagonal image slider works like an accordion that when you mouse hover it expand each image. Also you can add a title to the image to give a brief description.


Demo

Demo in jsFiddle
How to use

Your HTML:

<!DOCTYPE html>
<html>
<head>
	<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
	<script type="text/javascript" src="js/DiagonalSlider.js"></script>
</head>
<body>
	<div class="content_slider">
		<div class="content_title" data-default-text="<b>Diagonal Slider</b><br/>by @innvenio">
			<div class="text">
				<b>Diagonal Slider</b><br/>by @innvenio
			</div>
		</div>
		<div class="gallery_content">
			<div class="gallery_item">
				<img src="images/1.jpg" data-title="Image 1"/>
			</div>
			<div class="gallery_item">
				<img src="images/2.jpg" data-title="Image 2"/>
			</div>
			<div class="gallery_item">
				<img src="images/3.jpg" data-title="Image 3"/>
			</div>
			<div class="gallery_item">
				<img src="images/2.jpg" data-title="Image 4"/>
			</div>
			<div class="gallery_item">
				<img src="images/1.jpg" data-title="Image 5"/>
			</div>
		</div>		
	</div>
	<script type="text/javascript" src="js/script.js"></script>
</body>
</html>



Your script:

$(document).ready(function(){
	$('.gallery_content').createDiagonalSlider();
});



Your css:

img
{
	display: block;
	margin: 0px;
}

.content_title
{
	position: absolute;
	padding: 50px 40px 50px 80px;
	background-color: #FFF;
	z-index: 100;
	font-size: 22px;
	margin-left: -60px;
	-webkit-transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
	-moz-transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
	-ms-transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
	transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
}

.content_title .text
{
	-webkit-transform: translate3d(0, 0, 0) skew(20deg, 0deg);
	-moz-transform: translate3d(0, 0, 0) skew(20deg, 0deg);
	-ms-transform: translate3d(0, 0, 0) skew(20deg, 0deg);
	transform: translate3d(0, 0, 0) skew(20deg, 0deg);
}

.content_slider
{
	width: 100%;
	overflow: hidden;
}

.gallery_content
{
	overflow: hidden;
	margin-left: -170px;

}

.gallery_item
{
	float: left;
	overflow: hidden;
	vertical-align: top;
	margin-left: -2px;
	-webkit-transition: width 500ms;
	-moz-transition: width 500ms;
	-o-transition: width 500ms;
	transition: width 500ms;
	-webkit-transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
	-moz-transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
	-ms-transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
	transform: translate3d(0, 0, 0) skew(-20deg, 0deg);
}

.gallery_item img
{
	position: relative;
	-webkit-transform: translate3d(0, 0, 0) skew(20deg, 0deg);
	-moz-transform: translate3d(0, 0, 0) skew(20deg, 0deg);
	-ms-transform: translate3d(0, 0, 0) skew(20deg, 0deg);
	transform: translate3d(0, 0, 0) skew(20deg, 0deg);
}



Result:


diagonal-slider's People

Contributors

aesposito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diagonal-slider's Issues

Resize small to widescreen

Hello Innvenio Team,

Thank you for your awesome work on this library.

I get the following issue when I double-click on top of the browser-window to make it as wide as my screen, there are spaces between the pictures. But after a refresh, everything looks fine.

Can you help me with this?

homepage

Regards

ArianeLux

Problem: Slider text for Diagonal slider gets behind the images

Hi, I am testing your diagonal slider. When I paste the coding into a fixed container and have it positioned in the center of the webpage, the text description label for the images fell behind and got covered up by the sliding images. I have tried changing the z-index number but it does not solve the problem. Can you help to solve this issue?

I can't attached zip files here. If u need to see the codes, I can send it over using private email address.
I will hear from you soon.
Thx u,
Brian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.