CSS+js放大镜

2016-02-19 20:21 24 1 收藏

今天给大家分享的是由图老师小编精心为您推荐的CSS+js放大镜,喜欢的朋友可以分享一下,也算是给小编一份支持,大家都不容易啊!

【 tulaoshi.com - Web开发 】

head
    titleCSS Fisheye/title
    style type="text/css"
    span {font-size: x-small}
    /style
    script language="JavaScript" type="text/javascript"
    !--
      function convertPreBlocks() {}
var regular = "x-small";
function bigger(thing){
    thing.style.fontSize = "large";
   
    siblingElement = thing.previousSibling;
    while(siblingElement) {
        if(siblingElement.tagName=="SPAN") {
            siblingElement.style.fontSize = "medium";
            break;
        }
        siblingElement = siblingElement.previousSibling;
    }
    siblingElement = thing.nextSibling;
    while(siblingElement) {
        if(siblingElement.tagName=="SPAN") {
            siblingElement.style.fontSize = "medium";
            break;
        }
        siblingElement = siblingElement.nextSibling;
    }
}
function normal(thing){
    thing.style.fontSize = regular;
    siblingElement = thing.previousSibling;
    while(siblingElement) {
        if(siblingElement.tagName=="SPAN") {
            siblingElement.style.fontSize = regular;
            break;
        }
        siblingElement = siblingElement.previousSibling;
    }
    siblingElement = thing.nextSibling;
    while(siblingElement) {
        if(siblingElement.tagName=="SPAN") {
            siblingElement.style.fontSize = regular;
            break;
        }
        siblingElement = siblingElement.nextSibling;
    }
}
    // --
    /script
/head
body
h1CSS Fisheye/h1
pRun your mouse over the text below to see the effect. It's implemented using
CSS and Javascript. I got the idea from this a href="http://www.samuelwan.com/downloads/com.samuelwan.eidt/fisheyemenu/FisheyeMenuDemo.html"fisheye
demo/a, which uses the effect for menus, but is implemented using Flash. Laur
at a href="http://www.grapefruitdesign.com/"Grapefruit Designs/a pointed
to the same technique implemented as a Java applet at a href="http://www.cs.umd.edu/hcil/fisheyemenu/fisheyemenu-demo.shtml"HCIL,
Univ. of Maryland/a, and suggested that the idea had probably been around
since the 1960's. It also seems that Ted Nelson had described this and similar
techniques ("a href="http://xanadu.com/zigzag/fw99/billowing.html"billowing
and undulating text/a") in relation to his Xanadu project back in 1999./p
pMy a href="fisheye-old.html"earlier version/a only worked on Internet Explorer,
but the version here has been fixed for other browsers by a href="http://www.seairth.com/blog"Seairth
Jacobs/a. Also the previous version used a href=... to mark the lines,
the current version uses span i("for no particular reason")/i. /p
p
span onmouseover="bigger(this)" onmouseout="normal(this)"Tiger, tiger, burning
bright,/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"In the forest of
the night,/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"What immortal hand
or eye/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"Could frame thy fearful
symmetry?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"In what distant deeps
or skies/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"Burnt the fire of
thine eyes?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"On what wings dare
he aspire?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"What the hand dare
seize the fire?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"And what shoulder,
and what art,/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"Could twist the sinews
of thy heart?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"When thy heart began
to beat,/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"What dread hand forged
thy dread feet?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"What the hammer?
What the chain?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"In what furnace was
thy brain?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"What the anvil? What
dread grasp/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"Dared its deadly
terrors clasp?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"When the stars threw
down their spears/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"And watered heaven
with their tears,/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"Did He smile his
work to see?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"Did He who made the
lamb make thee?/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"Tiger, tiger, on
the mat,/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"You're nothing but
a pussy cat,/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"But damn your eyes
and rue the day!/spanbr/
span onmouseover="bigger(this)" onmouseout="normal(this)"I have to clean your
litter tray./span /p
piwith apologies to William Blake/i/p
pa href="http://66.70.191.189/cgi-bin/mt-comments.cgi?entry_id=1971"Comments
appreciated/a/p
/body
资料引用:http://www.knowsky.com/441326.html

来源:https://www.tulaoshi.com/n/20160219/1623438.html

延伸阅读
放大镜重点是把边框及手柄部分的质感和光感做出来。先做出各部分的图形,然后用设置好的渐变加上初步的质感,再用钢笔等工具勾出高光部分的选区,填充较亮的颜色加强质感。局部可以用图层样式来加强质感。 最终效果 1、新建文档500x500像素,背景白色。建新层,画一个黑色矩形。 2、添加图层样式。 3、用钢笔工具加点...
标签: flash教程
下面是 具体的制作过程 。 1.导入一张图片。并以这张图片为基础建立一个MovieClip,起名叫“pic”。 2.在场景的第一个图层“pic-small”中摆出这个“pic”的一个实例,大小与场景一样,作为小图。 3.新建一个图层“pic-big”,再摆出“pic”的一个实例,在Instance中输入“gback”。这张图将作为大图。现在先不用管它的...
标签: PS PS基础
下面先看最终效果图。 操作步骤 1、首先运行photoshop打开你喜欢的素材,然后使用椭圆选框工具创建一个圆形选区(按着Shift键拖动鼠标),如图所示。 2、调整选区的位置,然后按下Ctrl+J快捷键复制选区的内容到新图层中,如图所示。 3、执行滤镜扭曲球面化滤镜,根据素材的实际情况设置数量值,模式设为正常,如图所示。 效果图...
win7怎么关闭放大镜?   退出放大镜方法:win键+ESC键。 缩小方法:win键+-键,当然,想放大也可以按win键++键 Windows7开机自动运行放大镜,该如何解决? 问题描述:我电脑的系统是Windows7,有时开机后,系统自带的放大镜功能会自动启动,我不知道启动项里哪个是放大镜程序,请问如何取消。 win7关闭开...
标签: windows系统
Win8如何开启放大镜   Win8开启放大镜的方法如下: 方法一:打开轻松使用设置中心(win键+U),点击启动放大镜。 方法二:通过快捷键:开启放大镜windows键+加号键,缩小放大镜win键+减号键,关闭放大镜wtulaoshi.comindows键+ESC键。 方法三:打开运行(windows键+R键),输入magnify。 方法四:打开开始(w...

经验教程

269

收藏

49

精华推荐

老年人养生慎用放大镜

老年人养生慎用放大镜

豫式撸管

Photoshop制作剔透的蓝色放大镜

Photoshop制作剔透的蓝色放大镜

陌生的流年往事

Flash放大镜效果深入改进(1)

Flash放大镜效果深入改进(1)

A北神通讯

微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部