plugin.js

Gesponsorde koppelingen

PHP script bestanden

  1. index.html
  2. plugin.js

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(function($) {
    $.fn.youtube = function(youtubeID, width, height) {
        var defaults = {
            youtubeID: youtubeID,
            width: width,
            height: height
        };
          var options = $.extend(defaults, options);
            return this.each(function() {

                obj = $(this);
                obj.show();

                var youtubeID = defaults['youtubeID'];
                var width = defaults['width'];
                var height = defaults['height'];
                
                obj.html("<a href='http://www.youtube.com/watch?v=" + youtubeID + "'><img src='http://img.youtube.com/vi/" + youtubeID + "/0.jpg' width='" + width + "' height='" + height + "' border='0' style='margin:0; padding:0; width:" + width + "px; height:" + height + "px; border:0px;'></a>");
                obj.html("<iframe frameborder='0' marginheight='0' marginwidth='0' width='" + width + "' height='" + height + "' src='http://www.youtube.com/v/" + youtubeID + "' style='margin:0; padding:0; width:" + width + "px; height:" + height + "px; border:0px;'><a href='http://www.youtube.com/watch?v=" + youtubeID + "'><img src='http://img.youtube.com/vi/" + youtubeID + "/0.jpg' width='" + width + "' height='" + height + "' border='0' style='margin:0; padding:0; width:" + width + "px; height:" + height + "px; border:0px;'></a></iframe>");
                obj.show();
                
              });
     };
})(jQuery);

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.