Hallo,
Da das „rel“-Attribute in HTML5 nicht mehr Valide ist in einem , möchte ich es ersetzen durh das „data-rel“ attribute, welches durchaus Valide ist. Ich nutze Fancybox 2, und da wird das REL-Attribute benutzt. Bei Fancybox 1.3.4 konnte ich das easy ersetzen durch das „data-rel“. Hier irgendwie nicht. Ich habe folgende Links:
durch das hier ersetzt:
[HTML]Bild1[/HTML]
Und das hier ist der Java-Script Abschnitt:
[CODE]// jQuery plugin initialization
$.fn.fancybox = function (options) {
var opts = options || {},
selector = this.selector || ‚‘;
function run(e) {
var group = [];
e.preventDefault();
if (this.rel && this.rel !== '' && this.rel !== 'nofollow') {
group = selector.length ? $(selector).filter('[rel="' + this.rel + '"]') : $('[rel="' + this.rel + '"]');
}
if (group.length) {
opts.index = group.index(this);
F(group.get(), opts);
} else {
F(this, opts);
}
return false;
}
if (selector) {
D.undelegate(selector, 'click.fb-start').delegate(selector, 'click.fb-start', run);
} else {
$(this).unbind('click.fb-start').bind('click.fb-start', run);
}
};
}(window, document, jQuery));[/CODE]
Diesen habe ich so geändert:
[CODE]// jQuery plugin initialization
$.fn.fancybox = function (options) {
var opts = options || {},
selector = this.selector || ‚‘;
function run(e) {
var group = [];
e.preventDefault();
if (this.data-rel && this.data-rel !== '' && this.data-rel !== 'nofollow') {
group = selector.length ? $(selector).filter('[data-rel="' + this.data-rel + '"]') : $('[data-rel="' + this.data-rel + '"]');
}
if (group.length) {
opts.index = group.index(this);
F(group.get(), opts);
} else {
F(this, opts);
}
return false;
}
if (selector) {
D.undelegate(selector, 'click.fb-start').delegate(selector, 'click.fb-start', run);
} else {
$(this).unbind('click.fb-start').bind('click.fb-start', run);
}
};
}(window, document, jQuery));[/CODE]
Leider hat das nichts gebracht, nun geht die Funktion gar nicht mehr. Könnt ihr mir helfen?
Freue mich über jede Hilfe, vielen Dank schonmal.
Kaisch0