Skip to content

Commit

Permalink
Add click event with link
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan committed Nov 20, 2014
1 parent a943435 commit e68f48e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jQuery flacky slider plugin
##Load requirements
```html
<!--jQuery-->
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>

<!--UdSlider-->
<script src="./udslider/udslider.js"></script>
<link href="./udslider/udslider.css" rel="stylesheet">
<script src="./../source/udslider.js"></script>
<link href="./../source/udslider.css" rel="stylesheet">
```
##Initialize slider
```js
$(function(){
$('#udslider').udslider({
angle: 72, // Skew angle, по умолчанию 75
angle: 72, // Skew angle, default 75
count: 5, // Limit visible sliders join main
timer: 3500 // Time to autoslide, 0 - disable
});
Expand All @@ -31,6 +31,7 @@ $(function(){
<img src="slider-pics/01-slider-picture.jpg" alt="">
<img src="logo-slider/01-logo-slider.png" class="logo" alt="">
<p>description first</p>
<a href="http://domain.com"></a>
</li>
<li>
<img src="slider-pics/02-slider-picture.jpg" alt="">
Expand Down
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<img src="./images/slider-pics/01-slider-picture.jpg" alt="">
<img src="./images/logo-slider/01-logo-slider.png" class="logo" alt="">
<p>Жилой комплекс «Парус» в г. Ижевск – это комфорт, воплощенный в жизнь. Более того, это эксклюзивный объект жилой недвижимости, который, без сомнений, стоит приобрести.</p>
<a href="http://domain.com/"></a>
</li>
<li>
<img src="./images/slider-pics/02-slider-picture.jpg" alt="">
Expand Down
9 changes: 8 additions & 1 deletion source/udslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,12 @@

function activateSlide(){
t.panelText.hide().empty();

t.panelText.unbind('click');

t.getChildren().not('.deleting').each(function(i, el){
var li = $(el),
a = li.find('a').first(),
fade = li.find('.fade'),
logo = li.find('.logo'),
p = li.find('p'),
Expand All @@ -372,7 +376,10 @@
fade.fadeIn(200);
if(logo.length) t.panelText.append(logo.hide().clone().show());
if(p.length) t.panelText.append(p.clone());
t.panelText.fadeIn(300);

t.panelText.fadeIn(300).bind('click', function(){
location.href = a[0].href;
});
}else{
fade.fadeOut();
li.addClass('clickable');
Expand Down

0 comments on commit e68f48e

Please sign in to comment.