JavaScript Command Line
JavaScript Command Line
Go Big
Bookmarklet heaven: 居然有這個,真不愧是bookmarklet heaven
JavaScript Command Line
Go Big
Bookmarklet heaven: 居然有這個,真不愧是bookmarklet heaven
dynamic scrolling of an oversized DIV
int scrollLeft, scrollTop
The number of pixels that have scrolled off the left edge of the element or off the top edge of the element. These properties are useful only for elements with scrollbars, such as elements with the CSS overflow attribute set to auto. These properties are also defined on the <body> or <html> tag of the document (this is browser-dependent) and specify the amount of scrolling for the document as a whole. Note that these properties do not specify the amount of scrolling in an <iframe> tag. These are non-standard but well-supported properties.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>simple scroller</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div id="scroller_container" style="width:300px;border:2px solid #ccc;">
<div id="contents" style="height:100px; width:500px; overflow:auto;">
<img alt="image" src="myimage.gif" height="20" width="800" />
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Nulla at augue quis wisi tempus tempor. Praesent in neque.
Aliquam rhoncus sapien a erat. Nunc venenatis sem ut ligula.
Vivamus tellus arcu, sollicitudin sit amet, rhoncus ut, viverra ut, lectus.
Donec dolor urna, ultricies nec, porttitor et, cursus sed, dui.
Curabitur turpis mi, ornare non, euismod id, volutpat quis, lorem.</p>
<p>Mauris egestas neque in mauris. Cras vitae massa eget augue eleifend tincidunt.
Nulla et leo ac erat mattis viverra. Nulla tincidunt eros eget massa. Maecenas et neque.
Quisque interdum. Mauris lacinia wisi sit amet eros. Maecenas sodales.
Pellentesque non justo sed enim scelerisque vestibulum. Sed fringilla commodo justo.
Integer justo. Phasellus nec odio nec ante posuere fringilla.
Sed adipiscing, lectus non euismod consequat, orci augue ornare velit, quis gravida velit massa quis leo.</p>
Text <a href="http://www.lipsum.com/">Lorem Ipsum</a>
</div>
</div>
<p>
<button type="button" onclick="document.getElementById('contents').scrollTop-=20;">↑</button>
<button type="button" onclick=" document.getElementById('contents').scrollTop+=20;">↓</button>
<button type="button" onclick="document.getElementById('contents').scrollLeft-=20;">←</button>
<button type="button" onclick="document.getElementById('contents').scrollLeft+=20;">→</button>
</p>
</body>
</html>
Internet Explorer Developer Toolbar - 像是IE上面精簡版的 Web Developer, 重點項目是 DOM Inspector, 搭配 Web Accessibility Toolbar的 view generated source,可以減少在IE上開發的痛苦。
How to Make Equal Columns in CSS
IE (including IE7) doesn't support the display:table and display:table-cell properties (although Mozilla and other browsers do)
Web colors - Wikipedia, the free encyclopedia
Web design - Wikipedia, the free encyclopedia
Yahoo! Design Pattern Library
Relatively Absolute @ The Autistic Cuckoo
Free HTML Form Builder - Create Forms, Surveys and
這邊來列出一些color tools:
CSS Hacks & Issues - 這邊整理出一些常見的CSS Issues & hacks
* html #image-style {
background-image: none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="filename.png", sizingMethod="scale");
}
If you apply a width to an inline element it will only work inIE6. This is actually a fault of IE6 - inline elements shouldn't need to have a width assigned to them.
You can’t change the width of an inline element. A way around this is to change the element from inline to block.
span {
width: 150px;
display: block
}
Applying display: block will turn the span into a block element, allowing you to change the width. One thing to note however is that block elements will always start on a new line, so you might have to use floats as well.
<body style="text-align:center;">
<div id="wrapper" style="border: 1px solid #ccc; margin: 0 auto; width: 500px;">
sample text
</div>
</body>
標籤: CSS
記下來下次不用查
document.getElementsByTagName('a')[0].style.backgroundImage = 'url("images/ok.gif")';
標籤: CSS, JavaScript
Mozilla Taiwan 討論區: Firefox底下出現"menuitem label="&stopAll.label;" - 最近遇到這個問題,firefox底部出現一條的bar顯示menuitem,看到的解法有三種
1. 有關download statue bar -> 我沒裝,所以不是這個問題
2. Java主控台的 瀏覽器的預設Java的 Mozilla系列,打勾取消 -> 無效
3. 正解
解決方式:
修正
C:\Program Files\Mozilla Firefox\extensions\{CAFEEFAC-0016-0000-0001-ABCDEFFEDCBA}\chrome.manifest
內容中的
locale javaconsole1.6.0_01 zh-TW chrome/locale/zh_TW/ffjcext/
改成
locale javaconsole1.6.0_01 zh-TW chrome/locale/zh-TW/ffjcext/
然後以安全模式開啟firefox
C:\Program Files\Mozilla Firefox\firefox.exe” -safe-mode
退出firefox,再以正常方式啟動firefox就可以了。
Motion-Twin - MTASC is the first ActionScript 2 Open Source free compiler. 在這邊看到的,有Windows & Linux版本。範例:
mtasc src/classes/com/mammon/swfupload/*.as -swf SWFUpload.swf -version 8 -main -v -header 1:1:12:FFFFFF
Tsung's Blog | Programmer 專用最佳字型 - Monaco font
Cornelius' Blog: Monaco Font - 最近在survey寫程式用的字型,除了consolas, courier/courier new, Bitstream Vera Sans Mono, 還有這個Monaco font. download
今天遇到了一個很怪的bug,查到最後是一個動態產生的input沒有name的attribute,不論是用input.name = 'foo'; 或者 input.setAttribute('name', 'foo');都不會work,查了很久才發現這一篇文章,基本上算是個bug:
Setting the “name” attribute in Internet Explorer
The NAME attribute cannot be set at run time on elements dynamically created with the createElement method. To create an element with a name attribute, include the attribute and value when using the createElement method.
function createNamedElement(type, name) {
var element = null;
// Try the IE way; this fails on standards-compliant browsers
try {
element = document.createElement('<'+type+' name="'+name+'">');
} catch (e) {
}
if (!element || element.nodeName != type.toUpperCase()) {
// Non-IE browser; use canonical method to create named element
element = document.createElement(type);
element.name = name;
}
return element;
}