English 中文(简体)
CSS, Javascript行功能问题,涉及新浏览器的风格投入纽州? (IE 8/9,FF 9)
原标题:CSS, Javascript functionality issue relating to styled input buttons on newer browsers? (IE 8/9, FF 9)

I m working on a site where I have input buttons (styled using CSS) that are a part of a form. For example, see below for sample code

<input type="submit" name="buttonSave" value="save" id="buttonsavejs" class="button_image button_style"/>

我刚刚发现一个问题,即如果一个用户在纽顿点点上点击,就会把几个餐厅带走到下面,然后预计会采取行动时断时续<>。 但间歇,我指的是,有时它(将用户转至下页)运作,有时甚至没有发生。

从事这项工作的开发商曾大量记载了他的法典,因此,我试图在这里从头开始工作(以缺乏细节为借口)。 无论如何,在测试该守则之后,问题似乎在于新浏览器如何提供 c和 j。

The snippet of the javascript after the button sFunction:

$("#buttonsavejs").click(function(){
        $("#main").unbind("submit").submit();

而CSS则以 but子为风格

.button_style {
  height:28px;
  margin-left:10px;
  position:relative;
  right:10px;
  top:-23px;
  width:100px;
}

.button_image {
  background-image:url(http://some_image);
  border-bottom-width:0;
  border-color:initial;
  border-image:initial;
  border-left-width:0;
  border-right-width:0;
  border-style:initial;
  border-top-width:0;
  display:block;
  font-size:1px;
  line-height:1px;
  outline-color:initial;
  outline-style:none;
  outline-width:initial;
  overflow-x:hidden;
  overflow-y:hidden;
  position:relative;
  text-indent:-9999px;
}

此外,我注意到这里提出的一个非常相似的问题:。 为什么 mo点点不总是用于风格的投入纽芬兰?

我迄今能够发现的另一件事。 在E9中,如果我把文件转而使用IE 8或9以外的任何手段,则按原样行事。 因此,我必须把X-UA-Compatible to IE 7,并且看看,这是否决定了它作为IE文件工作方式:IE8 browser温器诉文件

Question: After testing in FF (earlier versions < 9.0), IE 7, I noticed that the button works as it should. But in FF 9, Chrome 16, IE 8/9, it behaves as described above. Has anyone run into a similar problem and any advice on what I should be watching out for?

问题回答

方便固定:

first, don t 用途 :

<input type="button" />

用途

<button type="button">bla bla bla</button> // you can 用途 type="submit"

页: 1

$("#buttonsavejs").click(function(e){
    e.preventDefault(); // this stops the button from doing it s default action, aka submit.




相关问题
Image rendered with wrong colors in IE8

I have a gradient image as a PNG (no transparency) in a web-page. By taking a screenshot of Chrome showing the page and cropping the image from the page, I see the exact same colors are drawn as the ...

Determine Mobile Internet Explorer version

I need to determine the version of Mobile Internet Explorer on a Windows Mobile 6.1 device. So that I can report the same user-agent string as is being used by Mobile Internet Explorer. The user-...

CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

Internet Explorer only part loading JavaScript/CSS

I m having trouble with my local development environment where IE (6 through to 8) is only part loading JavaScript/CSS files. It throws random errors at random places in jquery.min.js every time I ...

IE doesn t run Javascript when you click back button

I ve built a shop with tons of JS running. One of the pieces of the cart, is a zip code field which is required to calculate shipping cost. This works fine going through the cart. Now clicking ...