2016 Tianjin University Software Testing (homework1)

About A My project ERROR

Recently I was coding a project about visualization based on the city public utility with D3.js. I hope to draw the label text on my infographic and add a click event on it, so I write down a sentence--

.on("click",function(){...}

However, it did not work after several checks. So I was thinking if there is something or some blocks above my text to cause no response. After adding the code

.style('z-index','1000000')

to promote the layer the text lies on, I clicked the text again, but no miracle appeared. What's wrong with the text, and i was crazy about it. The worse thing was that there is nothing about no clicking event on text when i searched in the Internet.

Luckily, I opened the element checking window to see the text attributes, and focused on some words--

~~pointer-events: auto;~~

I was crazy again! The words mean no pointer events exist. This attribute was decleared in the globle area at the front of the project, so I just forgot it. The last thing is adding a few words in my project

.style('pointer-events','auto')

As a programmer, it is common that there will be a bug in a running code. Sometimes a little bug is difficult to catch. Because it stays where you can't think of. But, interestingly, when we find out the problem is, we mostly say,"what a stupid bug, how can I make this low-level bug!" instead of "Wow, I am so happy to find the bug is!" So paying attention to the details is very important for a programmer!

转载于:https://www.cnblogs.com/ida-xj/p/5248435.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值