Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView - css styling for html input button onmousedown
    primarykey
    data
    text
    <p>I've got a local html resource loading in a UIWebView. I've been styling that html document to look like a UITableView with some UIButton(s). I've had pretty good success so far. I'm just trying to get a input type=button to work like a UIButton in the way that it turns it blue when you press on it. Unfortunately I don't know how to turn off or restyle the button turning greyish (which is the default way it works on a UIWebView) when you press on it. Heres my button:</p> <pre><code>&lt;input class="iPhoneStandardButton" onmousedown="changeStyle(this,'iPhoneStandardButton_press');" onmouseup="changeStyle(this,'iPhoneStandardButton');" type="button" value="My Button" /&gt; </code></pre> <p>My changeStyle function (I've proven this works):</p> <pre><code>function changeStyle(element, newClassName){ element.setAttribute("class", newClassName); } </code></pre> <p>And my css:</p> <pre><code>.iPhoneStandardButton { width: 100%; height: 40px; background: #FFF; border-radius: 12px; border: 1px solid #CCC; font-size: 13; font-weight: bold; color: #000000; margin-bottom: 15px; } .iPhoneStandardButton_press{ width: 100%; height: 40px; border: solid 1px #666666; background: #058CF5; background: -webkit-gradient(linear, left top, left bottom, from(#058CF5), to(#015DE6)); background: -moz-linear-gradient(top, #058CF5, #015DE6); border-radius: 12px; font-size: 13; font-weight: bold; color: #ffffff; margin-bottom: 15px; } </code></pre> <p>I'm happy with the styles, it just doesn't apply on onmousedown. It still shows as the default greyed blur button press which UIWebView/safari seems to enforce on all buttons.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload