[jQuery,js] Video top-tip, very-very-very sexy!

rtyug
На сайте с 13.05.2009
Offline
263
730

нашел отлчиный скрипт top-tip, который позволяет вставить и картинки

хотел его использовать в для видео превью при наведении

http://vadikom.com/demos/poshytip/ (в самом низу для видео)

Loading Flickr Feeds

A more complicated example of loading some Flickr images by tags:

flowers, closeup, sunset, architecture, Plovdiv, old, town, Nesebar, depeche
View plain code

var flickrFeedsCache = {};


$('#demo-async-flickr > a').poshytip({
className: 'tip-darkgray',
bgImageFrameSize: 11,
alignY: 'bottom',
content: function(updateCallback) {
var rel = $(this).attr('rel');
if (flickrFeedsCache[rel] && flickrFeedsCache[rel].container)
return flickrFeedsCache[rel].container;
if (!flickrFeedsCache[rel]) {
flickrFeedsCache[rel] = { container: null };
var tagsComma = rel.substring(4).replace('-', ',');
$.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?tags=' + tagsComma + '&tagmode=all&format=json&jsoncallback=?',
function(data) {
var container = $('<div/>').addClass('flickr-thumbs');
$.each(data.items, function(i, item) {
$('<a/>')
.attr('href', item.link)
.append($('<img/>').attr('src', item.media.m))
.appendTo(container)
.data('tip', '<strong>' + (item.title || '(no title)') + '</strong><br />by: ' + item.author.match(/\((.*)\)/)[1]);
if (i == 4)
return false;
});
// add tips for the images inside the main tip
container.find('a').poshytip({
content: function(){return $(this).data('tip');},
className: 'tip-yellowsimple',
showTimeout: 100,
alignTo: 'target',
alignX: 'center',
alignY: 'bottom',
offsetY: 5,
allowTipHover: false,
hideAniDuration: 0
});
// store the content in the cache
// and call updateCallback() to update the content in the main tooltip
updateCallback(flickrFeedsCache[rel].container = container);
}
);
}
return 'Loading images...';
}
});


Проблема: по-моим тестам только в firefox2-3.6, при которым эти картинки показывается в одну линию, всего картинок превью 15-30 штук и они все в тупую в одну линию в браузере firefox...

если посмотреть, проблема, может в том что "что-то" опаздывает (возможно картинки d кэше браузера глючат, если поставить одну картинку, то они строятся нормально!!) короче, фиг его знает

исходники, этого top-tip http://vadikom.com/demos/poshytip/src/jquery.poshytip.js

как я вызывваю:

(пробовал все по разному)


$('[class^=va_news22]').poshytip({
className: 'tip-darkgray',
bgImageFrameSize: 11,
alignY: 'bottom',
NoIgnoreTitle: 666,
content: function(updateCallback) {


var original = $(this).attr('original');


if (flickrFeedsCache[original] && flickrFeedsCache[original].container)
return flickrFeedsCache[original].container;
if (!flickrFeedsCache[original]) {
flickrFeedsCache[original] = { container: null };

$.getJSON('/video/preview_json/'+original,
function(data) {

var container = $('<div/>').addClass('flickr-thumbs');

// $.each(data.items, function(i, item) {

// var imgg = new Array();

// for (var i = 0, len = data.data.length; i < len; i++) {
// imgg = $('<img/>').src('/video_preview/'+original+'/'+data.data.id_vfp+'.jpg');
// imgg = new Image();
// imgg = $("<img src='http://www.x0.org.ua/video_preview/"+original+"/"+data.data.id_vfp+".jpg' />");
// }



for (var i = 0, len = data.data.length; i < len; i++) {



$('<a/>')
.attr('href', '/video_view/'+original)
.append($('<img/>').attr('src', '/video_preview/'+original+'/'+data.data.id_vfp+'.jpg'))
.appendTo(container);

}





// });


// add tips for the images inside the main tip
container.find('a').poshytip({
content: function(){return $(this).data('tip');},
className: 'tip-yellowsimple',
showTimeout: 100,
alignTo: 'target',
alignX: 'center',
alignY: 'bottom',
offsetY: 5,
allowTipHover: false,
hideAniDuration: 0
});
// store the content in the cache
// and call updateCallback() to update the content in the main tooltip
updateCallback(flickrFeedsCache[original].container = container);
}
);
}
return 'Loading images...';
}
});

сайт, где проблема: http://www.x0.org.ua/ (при наведении на видео слева в панели или по центру там где "Все последние видео клипов:")

еще раз:

Проблема: по-моим тестам только в firefox2-3.6, при которым эти картинки показывается в одну линию, всего картинок превью 15-30 штук и они все в тупую в одну линию в браузере firefox...

Спалил тему: Pokerstars вывод WMZ, etc на VISA 0% или SWIFT + Конверт USD/GBP,etc (net profit $0,5 млрд) (https://minfin.com.ua/blogs/94589307/115366/) Monobank - 50₴ на счет при рег. тут (https://clck.ru/DLX4r) | Номер SIP АТС Москва 7(495) - 0Ꝑ, 8(800) - 800Ꝑ/0Ꝑ (http://goo.gl/XOrCSn)
rtyug
На сайте с 13.05.2009
Offline
263
#1

сделал!!

действительно опаздывало.

вариант решения с setTimeout, поставить паузу:

	        setTimeout(    function() {				
// store the content in the cache
// and call updateCallback() to update the content in the main tooltip
updateCallback(flickrFeedsCache[original].container = container);
}, 1000)

можно даже вместо 1000, поставить 500

ЗЫ: я что-то не догадался сразу, куда эту паузу втулить

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий