Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Tableta pareri

Musuroi mare

Tv nou

De ce nu miros hainele a balsam d...
 Canon EOS R1

Declaratie venit si siguranta XTB

Comanda laptop Amazon UK

Sfat achizitionare laptop gaming
 Telefonul Oppo a74 mi-a blocat ca...

A inviat Mudava

Import china alibaba

Facultate
 Vouchere de vacanta

Cand One United nu mai vand isi v...

Mandolina feliat legume

Atestat consilier de siguranta
 

Probleme cu Java Script!

- - - - -
  • Please log in to reply
No replies to this topic

#1
RAY'

RAY'

    Junior Member

  • Grup: Members
  • Posts: 202
  • Înscris: 13.04.2007
Lucrez la un site nu cine stie ce....ceva personal.....

Si dupa cum stiti cu toti de problema numita Internet Explorer 6 :death: .........a trebuit sa fac rost de pe net de un cod java script pt png-urile de pe site(png fix)nici o problema am facut rost a functionat

.......dar.....si eu ca tot omu cautand solutii de infrumusetare a site-ului am dat peste shadowbox o alternativa mai buna la lightbox...acuma poblema cea mare este ca daca introduc codul pt shadowbox Domnul Internet Explorer :thumbdown: :death: :death:   nu-mi mai citeste codul pt. png fix....si nu prea am idee ce sa fac

....dupa ce am facut niste cercetari prin fisierele mele am descoperit ca si shadow box are ceva legat de png fix dar nu imi dau seama ce....deoarece nu cunosc limbajul java script....si tinand cont ca eu stiu html si am inceput sa aprofundez css.....dorind sa ma orientez spre invatarea php.....nu e o solutie prea buna sa ma apuc sa invat java script(cea ce voi face in cele din urma....dar mai tarziu)asa ca am decis sa apelez la voi care stiti acest limbaj si poate ma sfatuiti si pe mine........

Codul din shadow box care cred ca are llegatura cu png fix este acesta:
if(typeof Shadowbox == 'undefined'){
	throw 'Unable to load Shadowbox skin, base library not found.';
}

/**
 * The HTML markup to use for Shadowbox.
 *
 * IMPORTANT: The script depends on most of these elements being present.
 *
 * @property	{Object}	SKIN
 * @public
 * @static
 */
Shadowbox.SKIN = {

	markup:	 '<div id="shadowbox_container">' +
					'<div id="shadowbox_overlay"></div>' +
					'<div id="shadowbox">' +
						'<div id="shadowbox_title">' +
							'<div id="shadowbox_title_inner"></div>' +
						'</div>' +
						'<div id="shadowbox_body">' +
							'<div id="shadowbox_body_inner"></div>' +
							'<div id="shadowbox_loading">' +
								'<div id="shadowbox_loading_indicator"></div>' +
								'<span><a onclick="Shadowbox.close();">{cancel}</a></span>' +
							'</div>' +
						'</div>' +
						'<div id="shadowbox_info">' +
							'<div id="shadowbox_info_inner">' +
								'<div id="shadowbox_counter"></div>' +
								'<div id="shadowbox_nav">' +
									'<a id="shadowbox_nav_close" title="{close}" onclick="Shadowbox.close()"></a>' +
									'<a id="shadowbox_nav_next" title="{next}" onclick="Shadowbox.next()"></a>' +
									'<a id="shadowbox_nav_play" title="{play}" onclick="Shadowbox.play()"></a>' +
									'<a id="shadowbox_nav_pause" title="{pause}" onclick="Shadowbox.pause()"></a>' +
									'<a id="shadowbox_nav_previous" title="{previous}" onclick="Shadowbox.previous()"></a>' +
								'</div>' +
								'<div class="shadowbox_clear"></div>' +
							'</div>' +
						'</div>' +
					'</div>' +
				'</div>',

 [b]   png_fix:	[
		'shadowbox_nav_close',
		'shadowbox_nav_next',
		'shadowbox_nav_play',
		'shadowbox_nav_pause',
		'shadowbox_nav_previous'
	]

};[/b]




iar codul care l-am gasit pentru a rezolva problema png-urilor este in doua fiisiere:
supersleight.js
var supersleight	= function() {
	
	var root = false;
	var applyPositioning = true;
	
	// Path to a transparent GIF image
	var shim			= 'x.gif';
	
	// RegExp to match above GIF image name
	var shim_pattern	= /x\.gif$/i;
	
	
	
	var fnLoadPngs = function() { 
		if (root) {
			root = document.getElementById(root);
		}else{
			root = document;
		}
		for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
			// background pngs
			if (obj.currentStyle.backgroundImage.match(/\.png/i) !== null) {
				bg_fnFixPng(obj);
			}
			// image elements
			if (obj.tagName=='IMG' && obj.src.match(/\.png$/i) !== null){
				el_fnFixPng(obj);
			}
			// apply position to 'active' elements
			if (applyPositioning && (obj.tagName=='A' || obj.tagName=='INPUT') && obj.style.position === ''){
				obj.style.position = 'relative';
			}
		}
	};

	var bg_fnFixPng = function(obj) {
		var mode = 'scale';
		var bg	= obj.currentStyle.backgroundImage;
		var src = bg.substring(5,bg.length-2);
		if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
			mode = 'crop';
		}
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
		obj.style.backgroundImage = 'url('+shim+')';
	};

	var el_fnFixPng = function(img) {
		var src = img.src;
		img.style.width = img.width + "px";
		img.style.height = img.height + "px";
		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
		img.src = shim;
	};
	
	var addLoadEvent = function(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				if (oldonload) {
					oldonload();
				}
				func();
			};
		}
	};
	
	return {
		init: function() { 
			addLoadEvent(fnLoadPngs);
		},
		
		limitTo: function(el) {
			root = el;
		},
		
		run: function() {
			fnLoadPngs();
		}
	};
}();

// limit to part of the page ... pass an ID to limitTo:
// supersleight.limitTo('header');

supersleight.init();



si fisierul supersleight-min

var supersleight=function(){var root=false;
	var applyPositioning=true;
	var shim='x.gif';
	var shim_pattern=/x\.gif$/i;
var fnLoadPngs=function(){if(root){root=document.getElementById(root);}else{root=doc
ument;}
for(var i=root.all.length-1,obj=null;(obj=root.all[i]);i--){if(obj.currentStyle.backgroundImage.match(/\.png/i)!==null){bg_fnFixPng(obj);}
if(obj.tagName=='IMG'&&obj.src.match(/\.png$/i)!==null){el_fnFixPng(obj);}
if(applyPositioning&&(obj.tagName=='A'||obj.tagName=='INPUT')&&obj.style.position===''){obj.style.position='relative';}}};var bg_fnFixPng=function(obj){var mode='scale';var bg=obj.currentStyle.backgroundImage;var src=bg.substring(5,bg.length-2);if(obj.currentStyle.backgroundRepeat=='no-repeat'){mode='crop';}
obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='"+mode+"')";obj.style.backgroundImage='url('+shim+')';};var el_fnFixPng=function(img){var src=img.src;img.style.width=img.width+"px";img.style.height=img.height+"px";img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')";img.src=shim;};var addLoadEvent=function(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload(
);}
func();};}};return{init:function(){addLoadEvent(fnLoadPngs);},limitTo:function(e
l){root=el;},run:function(){fnLoadPngs();}};}();supersleight.init();


Anunturi

Neurochirurgie minim invazivă Neurochirurgie minim invazivă

"Primum non nocere" este ideea ce a deschis drumul medicinei spre minim invaziv.

Avansul tehnologic extraordinar din ultimele decenii a permis dezvoltarea tuturor domeniilor medicinei. Microscopul operator, neuronavigația, tehnicile anestezice avansate permit intervenții chirurgicale tot mai precise, tot mai sigure. Neurochirurgia minim invazivă, sau prin "gaura cheii", oferă pacienților posibilitatea de a se opera cu riscuri minime, fie ele neurologice, infecțioase, medicale sau estetice.

www.neurohope.ro

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate