comparison client/digitallibrary/jquery/jquery.digilib.js @ 718:996a584f1a0b jquery

put styles in stylesheet. use relative positioning in embedded mode.
author robcast
date Mon, 31 Jan 2011 17:44:20 +0100
parents f2d8c338b761
children e2429ec1976e
comparison
equal deleted inserted replaced
717:f2d8c338b761 718:996a584f1a0b
804 804
805 // creates HTML structure for digilib in elem 805 // creates HTML structure for digilib in elem
806 var setupScalerDiv = function (data) { 806 var setupScalerDiv = function (data) {
807 var settings = data.settings; 807 var settings = data.settings;
808 var $elem = data.$elem; 808 var $elem = data.$elem;
809 $elem.addClass('digilib');
809 var $img, scalerUrl; 810 var $img, scalerUrl;
810 // fullscreen 811 // fullscreen
811 if (settings.interactionMode === 'fullscreen') { 812 if (settings.interactionMode === 'fullscreen') {
813 $elem.addClass('dl_fullscreen');
812 var imgSize = getFullscreenImgSize($elem); 814 var imgSize = getFullscreenImgSize($elem);
813 // fitwidth/height omits destination height/width 815 // fitwidth/height omits destination height/width
814 // if (data.dlOpts['fitheight'] !== '1') { 816 // if (data.dlOpts['fitheight'] !== '1') {
815 if (data.dlOpts['fitheight'] == null) { 817 if (data.dlOpts['fitheight'] == null) {
816 settings.dw = imgSize.width; 818 settings.dw = imgSize.width;
821 } 823 }
822 $img = $('<img/>'); 824 $img = $('<img/>');
823 scalerUrl = getScalerUrl(data); 825 scalerUrl = getScalerUrl(data);
824 // embedded mode -- try to keep img tag 826 // embedded mode -- try to keep img tag
825 } else { 827 } else {
828 $elem.addClass('dl_embedded');
826 $img = $elem.find('img'); 829 $img = $elem.find('img');
827 if ($img.length > 0) { 830 if ($img.length > 0) {
828 console.debug("img detach:", $img); 831 console.debug("img detach:", $img);
829 scalerUrl = $img.attr('src'); 832 scalerUrl = $img.attr('src');
830 $img.detach(); 833 $img.detach();
1149 $birdZoom.width(coords.width); 1152 $birdZoom.width(coords.width);
1150 $birdZoom.height(coords.height); 1153 $birdZoom.height(coords.height);
1151 $birdZoom.offset(coords); 1154 $birdZoom.offset(coords);
1152 } else { 1155 } else {
1153 // nice animation for embedded mode :-) 1156 // nice animation for embedded mode :-)
1154 $birdZoom.animate(coords, opts); 1157 $birdZoom.animate(coords);
1155 } 1158 }
1156 }; 1159 };
1157 1160
1158 // zooms by the given factor 1161 // zooms by the given factor
1159 var zoomBy = function(data, factor) { 1162 var zoomBy = function(data, factor) {