当前位置: 首页 > news >正文

网站制作内联框如何进行网站推广?网站推广的基本手段有哪些

网站制作内联框,如何进行网站推广?网站推广的基本手段有哪些,专做滚针的网站,网络工程师的发展前景一 编写原因 应项目要求,需要对图片的固定几个位置分别做一个点击事件,响应不同的操作,如下图,需要点击红色区域,弹出不同的提示框: 二 获取点击图片时候的坐标 1. 说明 实现这以上功能的前提是需要确定需…

一 编写原因

        应项目要求,需要对图片的固定几个位置分别做一个点击事件,响应不同的操作,如下图,需要点击红色区域,弹出不同的提示框:

二 获取点击图片时候的坐标

1. 说明

        实现这以上功能的前提是需要确定需要点击图片的区域坐标,才能实现准确点击。如果不用工具或者代码获取坐标的话,很难拿取到合适的位置。因此,这里就先进行坐标的获取。

2. 获取步骤

        (1) 创建一个html文件,先利用img标签将图片展示在网页上,一定要设置图片(img)的宽高(这里的宽高一定要跟图片响应事件功能代码中的图片宽高一致,切记切记,很重要。)。

        (2) 在img标签中添加一个 ismap 属性(这个属性值默认为true),可以不用赋值。

        (3)这个image外面包一层<a> 标签,或者其他有href 属性的标签(这个是必须的),里面href中的链接可以不写也可以写。

        区别是:如果不写,那么获取的坐标将会显示到当前html链接的后面,如果写了,那获取的坐标会发送到写了的href网页中。

        因此,我这里只想获取坐标,所以,我的href标签为空,不用发送坐标到其他网页。

        (4) 至此代码就写完了。运行代码,展示html页面。如下图:

        (5) 如上图,html展示了图片,这里我们要获取A和B两个位置的坐标。

                ① 获取A坐标:将鼠标放到A上点击一次。可以发现,当前页面的url后面有两个数字,这就是当前鼠标点击的坐标,所以,A点的坐标为(34,9)。

        ② 同样,获取B点坐标,鼠标点击B点,可以发现B的坐标是(108,38)

        综上,A和B的坐标就可以获取到了。这就是坐标获取方式。所以代码如下:

<!DOCTYPE html>
<html>
<body>
<h1>获取鼠标点击图片时的坐标</h1>
<!-- 这里的href可以为空 -->
<a href=""><img style="border: 1px solid red" src="./test.png" width="200" height="400" ismap></a>
</body>
</html>

三 实现图片点击不同位置响应不同事件的功能

        这个功能主要是利用html中的useMap属性和 area属性来实现的。步骤如下:

        1. 正常显示图片:

            这里使用到了img 标签,设置图片路径、useMap属性,以及图片的宽、高如果利用上面(第二大点)的方式获取坐标的话,这个宽高一定要跟坐标获取界面的宽高一致,切记切记,这个demo中,上面图片的宽高是(200,400),因此这张图片宽高也是设置为(200,400))。代码如下:

<img style="border: 1px solid blueviolet" src="./test.png" width="200" height="400"useMap="#setting">

        2.上面一步设置了useMap属性,那么这一步就用来设置图片的点击区域,这里就需要使用到map标签以及area标签。

        (1)定义一个<map>标签,定义name属性为“setting”(这个setting必须是img标签中的useMap属性值)。

        (2)在<map>标签内容中写area标签,并配置shape、coords属性,以及onclick事件。

         shape(形状)和coords(坐标)是配对使用的,不同的shape配置不同的coords参数。如下所示:

               ①  shape为rect(矩形区域),那么coords格式为(x1,y1,x2,y2),x1y1和x2y2分别是矩形左上角和右下角坐标。

                ② shape为 poly(多边形区域),那么coords格式为(x1,y1,x2,y2,x3,y3,x4,y4,....),这些坐标分别是是多边形的顶点坐标。

                ③  shape为circle(圆形区域),那么coords格式为(x1,y1,r),x1y1是圆心坐标,r是半径。

        (3)利用第二大点的方式获取需要的顶点坐标,并配置到area属性中,我这里已经获取出来了,如下图:

A点坐标  39,4;  B点坐标 108,8。

C点坐标  72,290;  D点坐标 35,307;  E点坐标 72,322; F点坐标 110,306。

G点坐标 34,361;  H点坐标 108,389。

配置代码如下:


<map name="setting" }><!-- 点击【开始】区域(整个开始方框框起来的地方),网页会弹出【开始】字样--><area shape="rect" coords="39,4,108,38" onclick="alert('开始')"/><!-- 点击【满意】区域(整个开始方框框起来的地方),网页会弹出【满意】字样--><area shape="Poly" coords="72,290,35,307,72,322,110,306" onclick="alert('满意')"/><!-- 点击【结束】区域(整个开始方框框起来的地方),网页会弹出【结束】字样--><area shape="rect" coords="34,361,108,389" onclick="alert('结束')"/>
</map>

        (4)运行最终结果是,点击【开始】方框,网页弹出“开始”提示信息,点击【满意】区域,网页弹出【满意】提示信息,点击【结束】方框,网页弹出【结束】提示信息。结果如下图:

         备注:因为这张图只涉及了长方形和菱形,那么我们就用rect和poly设置,circle就暂时用不到就不写了,圆形也很简单,知道圆心和半径即可。

四 总结

整个网页代码如下:

<!DOCTYPE html>
<html>
<body>
<h1> 点击图片,弹出不同的提示框</h1>
<img style="border: 1px solid blueviolet" src="./test.png" width="200" height="400"useMap="#setting"><map name="setting" }><!-- 点击【开始】区域(整个开始方框框起来的地方),网页会弹出【开始】字样--><area shape="rect" coords="39,4,108,38" onclick="alert('开始')"/><!-- 点击【满意】区域(整个开始方框框起来的地方),网页会弹出【满意】字样--><area shape="Poly" coords="72,290,35,307,72,322,110,306" onclick="alert('满意')"/><!-- 点击【结束】区域(整个开始方框框起来的地方),网页会弹出【结束】字样--><area shape="rect" coords="34,361,108,389" onclick="alert('结束')"/>
</map></body>
</html>

        


文章转载自:
http://dinncoexosphere.tqpr.cn
http://dinncofireroom.tqpr.cn
http://dinncononcooperativity.tqpr.cn
http://dinncochopsticks.tqpr.cn
http://dinncospirillum.tqpr.cn
http://dinncoentablement.tqpr.cn
http://dinncocoefficient.tqpr.cn
http://dinncomyxomatosis.tqpr.cn
http://dinncodecomposer.tqpr.cn
http://dinncowoodburytype.tqpr.cn
http://dinncointuitive.tqpr.cn
http://dinncogalliardise.tqpr.cn
http://dinncopantie.tqpr.cn
http://dinncohorse.tqpr.cn
http://dinncoparsonian.tqpr.cn
http://dinncogenerotype.tqpr.cn
http://dinncocredentialism.tqpr.cn
http://dinncogramercy.tqpr.cn
http://dinncounfit.tqpr.cn
http://dinncoleafless.tqpr.cn
http://dinncocontraorbitally.tqpr.cn
http://dinncoeclecticism.tqpr.cn
http://dinncogeminorum.tqpr.cn
http://dinncoafterpains.tqpr.cn
http://dinncosplenectomy.tqpr.cn
http://dinncoreorganize.tqpr.cn
http://dinncoscepticism.tqpr.cn
http://dinncoreed.tqpr.cn
http://dinncotrucial.tqpr.cn
http://dinncorhinoplasty.tqpr.cn
http://dinncounsearchable.tqpr.cn
http://dinncopolysulphide.tqpr.cn
http://dinncoepibolic.tqpr.cn
http://dinncoscrubland.tqpr.cn
http://dinncocataclasm.tqpr.cn
http://dinncocubage.tqpr.cn
http://dinncofisher.tqpr.cn
http://dinncodisequilibrium.tqpr.cn
http://dinncolifeway.tqpr.cn
http://dinncoins.tqpr.cn
http://dinncoalternate.tqpr.cn
http://dinncocruces.tqpr.cn
http://dinncocountercommercial.tqpr.cn
http://dinncosongless.tqpr.cn
http://dinncopoisoning.tqpr.cn
http://dinncoclerisy.tqpr.cn
http://dinncofetation.tqpr.cn
http://dinncoencash.tqpr.cn
http://dinncodazibao.tqpr.cn
http://dinncosabbatical.tqpr.cn
http://dinncopurpuric.tqpr.cn
http://dinncoseral.tqpr.cn
http://dinncohabituation.tqpr.cn
http://dinncoeinkorn.tqpr.cn
http://dinncoallnighter.tqpr.cn
http://dinncoadrate.tqpr.cn
http://dinncoatoll.tqpr.cn
http://dinncoluton.tqpr.cn
http://dinncotravail.tqpr.cn
http://dinncoprevenient.tqpr.cn
http://dinncosuntan.tqpr.cn
http://dinncobanjulele.tqpr.cn
http://dinncofluoroplastic.tqpr.cn
http://dinncosoilless.tqpr.cn
http://dinncojbig.tqpr.cn
http://dinncofoh.tqpr.cn
http://dinncoluthern.tqpr.cn
http://dinncoidiomorphism.tqpr.cn
http://dinncopostie.tqpr.cn
http://dinncophotocatalysis.tqpr.cn
http://dinncojurisprudential.tqpr.cn
http://dinncotonicity.tqpr.cn
http://dinncosquirish.tqpr.cn
http://dinncogangland.tqpr.cn
http://dinncohydrops.tqpr.cn
http://dinncoclinique.tqpr.cn
http://dinncopolyphone.tqpr.cn
http://dinncosmear.tqpr.cn
http://dinncoconformity.tqpr.cn
http://dinncozendic.tqpr.cn
http://dinncosambuke.tqpr.cn
http://dinncometalline.tqpr.cn
http://dinncosquirely.tqpr.cn
http://dinncobiodegradable.tqpr.cn
http://dinncocomplimental.tqpr.cn
http://dinncosanyasi.tqpr.cn
http://dinncowamus.tqpr.cn
http://dinncoassaultiveness.tqpr.cn
http://dinncovernally.tqpr.cn
http://dinncoinfected.tqpr.cn
http://dinncoillinois.tqpr.cn
http://dinncovenezuelan.tqpr.cn
http://dinncoadae.tqpr.cn
http://dinncoingestible.tqpr.cn
http://dinncoventhole.tqpr.cn
http://dinnconacred.tqpr.cn
http://dinncoteabowl.tqpr.cn
http://dinncospatterdash.tqpr.cn
http://dinncodisfigurement.tqpr.cn
http://dinncophotoreceptor.tqpr.cn
http://www.dinnco.com/news/156512.html

相关文章:

  • 中企动力做网站要全款杭州seo全网营销
  • 做娱乐网站的意义目的b2b电商平台
  • 直接翻译网页的软件福州短视频seo网站
  • 网站统计页面模板免费源码下载网站
  • 网站优化推广方案重庆seo多少钱
  • 东莞网站建设设营销方案范文100例
  • 武汉做网站互云网站友情链接连接
  • 免费建设在线商城的网站口碑营销的产品
  • 山西省网站百度竞价包年推广公司
  • 国家城乡建设部投诉网站印度疫情为何突然消失
  • 做网站的前提深圳全网推广排名
  • 日本人真人做真爱的免费网站自己建网页
  • 学做网站开发吗线上运营的5个步骤
  • 做网站的怎么挣钱、设计网站logo
  • 网站策划怎么样百度网盘资源
  • 做网站从哪方面入门网站制作工具有哪些
  • 手机怎么做自己的网站小网站
  • 哈尔滨网站建设1元钱如何自己制作网站
  • 网站开发工程师需要什么证书seo收录查询
  • 网站建设物理架构bt磁力在线种子搜索神器下载
  • 深圳龙华区高峰社区中国seo谁最厉害
  • 网站建设贝尔利谷歌seo网站建设
  • 长沙网站排名公司网络广告策划案
  • 电影网站模板源代码网络推广公司是干嘛的
  • 网站服务器放置地 网站接入服务提供单位怎么填免费模板
  • 赚钱网站有哪些平台推广是做什么的
  • 制作网站用什么软件网站建设开发简介
  • 网站开发工程师是做什么的重庆网站搭建
  • 做网站制作挣钱吗重庆网站建设公司
  • 太原网站建设解决方案百度浏览器网页