سؤال

لدي هذا JavaScript: giveacodicetagpre.

أريد محاكاة تأثير مروم على صورة، ولكن بطريقة أو بأخرى لا تعمل وظيفة المرشح. حاولت أيضا giveacodicetagpre.

هل كانت مفيدة؟

المحلول

Try this:

$.fn.rand = function(){
    return this.eq(Math.floor(Math.random()*this.length));
};
$(".foto").rand().trigger("mouseover");

Note: you only have to define $.fn.rand once, usually right after including jquery.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top