Skip to content

Commit add5f33

Browse files
committed
Tweaks to pull #604
1 parent b72e317 commit add5f33

File tree

4 files changed

+124
-127
lines changed

4 files changed

+124
-127
lines changed

demos/css/page.css

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ul li { font: 15px Georgia, Serif; margin: 0 0 8px 0; }
4242
#main #slider2 { width: 800px; height: 390px; list-style: none; }
4343

4444
/* Set slider1 panel 5 stuff - adding padding directly to the panel will
45-
shift panels after it, so we need a wrapper */
45+
shift panels after it, so we need a wrapper */
4646
#main #slider1 .panel5 ul { width: 200px; margin: 0 5px; }
4747

4848
/* Set slider2 panel sizes, Main & FX demo pages */
@@ -79,7 +79,7 @@ ul li { font: 15px Georgia, Serif; margin: 0 0 8px 0; }
7979
#cboxTitle { color: #000 !important; }
8080

8181
/* Change metallic slider defaults to show thumbnails -
82-
using #demo2 (page wrapper) to increase this CSS priority */
82+
using #demo2 (page wrapper) to increase this CSS priority */
8383
#demo2 div.anythingControls { bottom: 25px; }
8484
#demo2 div.anythingSlider-metallic .thumbNav a { background-image: url(); height: 30px; width: 30px; border: #000 1px solid; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; }
8585
#demo2 div.anythingSlider-metallic .thumbNav a span { visibility: visible; }
@@ -111,10 +111,10 @@ ul li { font: 15px Georgia, Serif; margin: 0 0 8px 0; }
111111
#slider3 .caption-top,
112112
#slider3 .caption-right,
113113
#slider3 .caption-bottom,
114-
#slider3 .caption-left { background: #000; color: #fff; padding: 10px; margin: 0; position: absolute; z-index: 10; opacity: .8; filter: alpha(opacity=80); }
114+
#slider3 .caption-left { background: #000; color: #fff; padding: 10px; margin: 0; position: absolute; z-index: 10; opacity: .8; filter: alpha(opacity=80); }
115115

116116
/* Top caption - padding is included in the width (480px here, 500px in the script), same for height */
117-
#slider3 .caption-top { left: 0; top: 0; width: 480px; height: 30px; }
117+
#slider3 .caption-top { left: 0; top: 0; width: 480px; height: 30px; }
118118

119119
/* Right caption - padding is included in the width (130px here, 150px in the script), same for height */
120120
#slider3 .caption-right { right: 0; bottom: 0; width: 130px; height: 180px; }
@@ -166,19 +166,18 @@ body#expand h3 { text-align: center; }
166166
.group { border: #000 1px solid; }
167167

168168
/**************************
169-
Updating Video
170-
**************************/
171-
169+
Updating Video
170+
**************************/
172171
#updatingVideoDemo div#slider1, ul#slider1 div {
173-
width: 300px;
174-
height: 200px;
175-
list-style: none;
172+
width: 300px;
173+
height: 200px;
174+
list-style: none;
176175
}
177176

178177
#updatingVideoDemo div#slider2, div#slider2 div {
179-
width: 300px;
180-
height: 200px;
181-
list-style: none;
178+
width: 300px;
179+
height: 200px;
180+
list-style: none;
182181
}
183182

184183
#updatingVideoDemo .updatingVideoDemoInputs {
@@ -192,29 +191,29 @@ Updating Video
192191
/******************
193192
css3 demo page
194193
******************/
195-
.animations { margin: 20px 20px 20px 5px; }
196-
.ani { margin-top: 10px; }
194+
.animations { margin: 20px 20px 20px 5px; }
195+
.ani { margin-top: 10px; }
197196

198197
/******************
199198
tooltips (Jatt)
200199
******************/
201200
.tooltip { cursor: pointer; }
202201
#tooltip {
203-
min-width: 100px;
204-
color: #dddddd;
205-
background: #444;
206-
border: 1px solid #777;
207-
padding: 8px;
208-
display: none;
209-
opacity: 0.9;
210-
filter: alpha(opacity=90);
211-
text-align: left;
212-
border-radius: .5em;
213-
-moz-border-radius: .5em;
214-
-webkit-border-radius: .5em;
215-
z-index: 1000;
202+
min-width: 100px;
203+
color: #dddddd;
204+
background: #444;
205+
border: 1px solid #777;
206+
padding: 8px;
207+
display: none;
208+
opacity: 0.9;
209+
filter: alpha(opacity=90);
210+
text-align: left;
211+
border-radius: .5em;
212+
-moz-border-radius: .5em;
213+
-webkit-border-radius: .5em;
214+
z-index: 1000;
216215
}
217216
#tooltip .body {
218-
display: block;
219-
text-align: center;
220-
}
217+
display: block;
218+
text-align: center;
219+
}

js/jquery.anythingslider.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@
341341
base.navWidths = base.$nav.find('li').map(function(){
342342
return $(this).outerWidth(true) + Math.ceil(parseInt($(this).find('span').css('left'),10)/2 || 0);
343343
}).get();
344-
base.navLeft = base.currentPage;
344+
// start navLeft at one so calling base.navWindow() will position the current page on the left
345+
base.navLeft = 1;
345346
// add 25 pixels (old IE needs more than 5) to make sure the tabs don't wrap to the next line
346347
base.$nav.width( base.navWidth( 1, base.pages + 1 ) + 25 );
347348
base.$controls.find('.anythingNavWindow')

js/jquery.anythingslider.video.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,17 @@
2424
}
2525
// ,onVideoInitialized : function(base){}
2626
};
27-
2827

2928
return this.each(function(){
3029
// make sure a AnythingSlider is attached
31-
var video, tmp, service, sel, base = $(this).data('AnythingSlider');
30+
var video, tmp, service, sel, panel,
31+
base = $(this).data('AnythingSlider');
3232
if (!base) { return; }
33-
//if anythingSliderVideo was initialized before, don't overwrite it
33+
// if anythingSliderVideo was initialized before, don't overwrite it
3434
if(typeof base.video == 'undefined'){
3535
video = base.video = {};
36-
// Next update, I may just force users to call the video extension instead of it auto-running on window load
37-
// then they can change the video options in that call instead of the base defaults, and maybe prevent the
38-
// videos being initialized twice on startup (once as a regular video and second time with the API string)
3936
video.options = $.extend({}, defaults, options);
40-
37+
4138
// check if SWFObject is loaded
4239
video.hasSwfo = (typeof(swfobject) !== 'undefined' && swfobject.hasOwnProperty('embedSWF') && typeof(swfobject.embedSWF) === 'function' && swfobject.hasFlashPlayerVersion('1'));
4340
video.list = {};
@@ -51,28 +48,28 @@
5148
video = base.video;
5249
video.$items = base.$items.filter(':not(.cloned)');
5350
}
54-
51+
5552
// find and save all known videos
5653
for (service in video.services) { /*jshint loopfunc:true */
5754
if (typeof(service) === 'string') {
5855
sel = video.services[service].selector;
5956
video.$items.find(sel).each(function(){
6057
tmp = $(this);
61-
var pan = tmp.closest('.panel');
62-
if(pan.data('AnythingSliderVideoInitialized') != true){
58+
panel = tmp.closest('.panel');
59+
if (panel.data('AnythingSliderVideoInitialized') != true){
6360
// save panel and video selector in the list
6461
tmp.attr('id', video.options.videoId + $.fn.anythingSliderVideo.videoIndex);
6562
video.list[$.fn.anythingSliderVideo.videoIndex] = {
6663
id : video.options.videoId + $.fn.anythingSliderVideo.videoIndex++,
67-
panel : pan[0],
64+
panel : panel[0],
6865
service : service,
6966
selector : sel,
70-
status : -1, // YouTube uses -1 to mean the video is unstarted
71-
isInitialized : false, //Mark as Initialized to prevent double initialisation on adding video to slider
67+
status : -1, // YouTube uses -1 to mean the video is unstarted
68+
isInitialized : false, // Mark as Initialized to prevent double initialisation on adding video to slider
7269
};
7370

74-
//add indicator that this video was already initialized
75-
pan.data('AnythingSliderVideoInitialized', true);
71+
// add indicator that this video was already initialized
72+
panel.data('AnythingSliderVideoInitialized', true);
7673
video.hasVid = true;
7774
if (sel.match('embed|object')) {
7875
video.hasEmbed = true;
@@ -84,7 +81,7 @@
8481
});
8582
}
8683
}
87-
84+
8885
// Initialize each video, as needed
8986
$.each(video.list, function(i,s){
9087
// s.id = ID, s.panel = slider panel (DOM), s.selector = 'jQuery selector'
@@ -275,7 +272,7 @@ $.fn.anythingSliderVideo.services = {
275272
$vid.attr('src', function(i,r){
276273
// initialze api and add wmode parameter
277274
return r + (vidsrc.match(/\?/g) ? '' : '?') + '&wmode=' + (base.video.options.wmode || base.options.addWmodeToObject) +
278-
'&api=1&player_id=' + $vid[0].id;
275+
'&api=1&player_id=' + $vid[0].id;
279276
});
280277
},
281278
cont : function(base, $vid, index){

0 commit comments

Comments
 (0)