user-experience

Accessible toggle

让人想犯罪 __ 提交于 2019-11-27 07:32:51
问题 We are redesigning our website and there are some concerns internally that accessibility affects the design element. A toggle mode was suggested. Our standard version would still be accessible with the exception of contrast ratio and larger font size, which would be made available when you toggle to accessible mode. Has anyone had any experience with this? 回答1: WCAG 2.0 allows a conforming alternate version (under some conditions): For Level A conformance (the minimum level of conformance),

Hide traceback unless a debug flag is set

不问归期 提交于 2019-11-27 05:24:21
问题 What is the idiomatic python way to hide traceback errors unless a verbose or debug flag is set? Example code: their_md5 = 'c38f03d2b7160f891fc36ec776ca4685' my_md5 = 'c64e53bbb108a1c65e31eb4d1bb8e3b7' if their_md5 != my_md5: raise ValueError('md5 sum does not match!') Existing output now, but only desired when called with foo.py --debug : Traceback (most recent call last): File "b:\code\apt\apt.py", line 1647, in <module> __main__.__dict__[command] (packages) File "b:\code\apt\apt.py", line

Possible to detect if a user has multiple tabs of your site open?

Deadly 提交于 2019-11-27 01:08:55
问题 I'm just thinking about the whole site registration process. A user goes to your site, signs up, and then you tell him you've sent him an email and he needs to verify his email address. So he hits Ctrl + T , pops open a new tab, hits his Gmail fav button, doesn't read a word of your lengthy welcome email, but clicks the first link he sees. Gmail opens your site in yet another tab... He doesn't need nor want two tabs for your site open, he just wants to view that darn page you've disallowed

What is the most accurate way to emulate the “placeholder” attribute in browsers that don't support it natively?

牧云@^-^@ 提交于 2019-11-26 22:18:40
问题 Recently I have been looking at jquery/javascript solutions to emulating the placeholder attribute, but none of them seem to have it right. Common issues are: Native browser support is not used first The form may actually post the value of the placeholder text Inability to recognize between placeholder text and user input if the values are identical (Hey, my email IS user@example.com!! Why won't it submit? Hey I wanted to search for the string "Search" but it won't let me!) Difficult to style

JavaScript in <head> or just before </body>?

拟墨画扇 提交于 2019-11-26 21:58:54
I am about to embark on a new web project and I plan to put some JavaScripts in the <head> and also some before </body> , using the following scheme: Scripts that are essential for the UX of the page: in the <head> . As I've picked up perusing the web - scripts in the <head> is loaded before the page loads, so it would make sense to put scripts that are essential to the user experience there. Scripts that are non-essential to the design and UX (Google Analytics scripts etc.): before the </body> . Is this a sensible approach? Another approach would be to put all the scripts in the <head> and

What is a better way to sort by a 5 star rating?

旧街凉风 提交于 2019-11-26 19:18:33
I'm trying to sort a bunch of products by customer ratings using a 5 star system. The site I'm setting this up for does not have a lot of ratings and continue to add new products so it will usually have a few products with a low number of ratings. I tried using average star rating but that algorithm fails when there is a small number of ratings. Example a product that has 3x 5 star ratings would show up better than a product that has 100x 5 star ratings and 2x 2 star ratings. Shouldn't the second product show up higher because it is statistically more trustworthy because of the larger number

Make a wizard like application in Android

送分小仙女□ 提交于 2019-11-26 18:12:57
问题 Which you think is the best way of doing a wizard like application (user can navigate between screens with a next and back button, and each screen has to save some state data) in Android platform. I mainly can think in two approaches: Having one activity+view for each screen and then i make the screen switch by calling each activity. What make this nice is that i can use the system back button as my back handler and i don't have to take care of that myself, aslo each activity will save it's

How to set initial values for NSUserDefault Keys?

守給你的承諾、 提交于 2019-11-26 15:37:32
问题 I want to set some initial values for my NSUserDefault keys so that the first run of the app has some reasonable initial settings. I thought I ran across a simple way to do this in the app bundle .plist, but now I can't find it. Any ideas? 回答1: You should use the registerDefaults method of NSUserDefaults . Prepare a plist file in your bundle that contains the default preferences and then use that plist to register the defaults. NSString *defaultPrefsFile = [[NSBundle mainBundle]

Setting background colour of Android layout element

五迷三道 提交于 2019-11-26 14:59:09
问题 I am trying to, somewhat clone the design of an activity from a set of slides on Android UI design. However I am having a problem with a very simple task. I have created the layout as shown in the image, and the header is a TextView in a RelativeLayout . Now I wish to change the background colour of the RelativeLayout , however I cannot seem to figure out how. I know I can set the android:background property in the RelativeLayout tag in the XML file, but what do I set it to? I want to define

Client-side “Feature Tour” (tutorial/instructional) overlay system? [closed]

依然范特西╮ 提交于 2019-11-26 14:59:01
问题 Is there a system/framework in existence which focuses on providing tutorial / help like overlays in the browser? Example: You have a webapp which requires a certain level of instruction to the user. In this instruction process you wish to "highlight" (e.g. arrow, colour shading, pulsing border, etc) a certain element on the page, with an accompanied message. This would be a true overlay, so it would function only in absolute positioning, and not interfere with the existing layout. I'm