Архив

Архив Ноябрь 2014
28 ноября 2014 Нет комментариев
function addLink() {
	var body_element=document.getElementsByTagName('body')[0];
	var selection;
	selection=window.getSelection();
	var pagelink="<br/><br/>Источник: <a href='"+document.location.href+"'>"+document.location.href+"</a><br/><br/>";
	var copytext=selection+pagelink;
	var newdiv=document.createElement('div');
	newdiv.style.position='absolute';
	newdiv.style.left='-99999px';
	body_element.appendChild(newdiv);
	newdiv.innerHTML=copytext;
	selection.selectAllChildren(newdiv);
	window.setTimeout(function() {
		body_element.removeChild(newdiv);
	},0);
}
document.oncopy=addLink;
Categories: Javascript Tags:
25 ноября 2014 Нет комментариев

В примере устанавливаем для всех элементов с class catalog_item высоту самого высокого.

function setEqualHeight(columns){
	var tallestcolumn=0;
	columns.each(
		function(){
			currentHeight=$(this).height();
			if(currentHeight>tallestcolumn) {
				tallestcolumn=currentHeight;
			}
		}
	);
	columns.height(tallestcolumn);
}
$(window).load(function() {
	setEqualHeight($(".catalog_item"));
});

Читать далее…

Categories: Javascript Tags:
21 ноября 2014 Нет комментариев
function rrmdir($dir) {
	if (is_dir($dir)) {
		$objects=scandir($dir);
		foreach ($objects as $object) {
			if ($object != "." && $object != "..") {
				if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
			}
		}
		reset($objects);
		rmdir($dir);
	} 
}
rrmdir($_SERVER['DOCUMENT_ROOT']."/bitrix/");
Categories: PHP Tags: