Search Results

Search found 5631 results on 226 pages for 'daniel a white'.

Page 116/226 | < Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >

  • CustomButton Field not aligning in the center

    - by rupesh
    Hi all I have created a custom button and i am placing the bunch of Custombuttons in a verticalfieldManager , I have aligned the verticalField Manager in the center. when i am creating a default buttonField then verticalfield Manager is able to align the buttonfield in the center. but when i am assigning custombuttonfield in the verticalField Manager it's not aligning in the center. here is my custombuttoncode enter code herepublic CustomButtonField(String label,long style) { super(style); this.label = label; onPicture = Bitmap.getBitmapResource(onPicturePath); font = getFont(); this.setPadding(5,5, 5, 5); } public String getLabel() { return label; } public int getPreferredHeight() { return onPicture.getHeight(); } public int getPreferredWidth() { return onPicture.getWidth(); } protected void layout(int width , int height) { setExtent(Math.min(width, Display.getWidth()), Math.min(height,getPreferredHeight())); } protected void paint(Graphics graphics) { int texty =(getHeight()-getFont().getHeight())/2; if (isFocus()) { graphics.setColor(Color.BLACK); graphics.drawBitmap(0, 0, getWidth(), getHeight(),onPicture , 0, 0); graphics.setColor(Color.WHITE); graphics.setFont(font); graphics.drawText(label,0,texty,DrawStyle.ELLIPSIS,getWidth()); } else { graphics.drawBitmap(0, 0, getWidth(), getHeight(),onPicture , 0, 0); graphics.setColor(Color.WHITE); graphics.setFont(font); graphics.drawText(label,0,texty,DrawStyle.ELLIPSIS,getWidth()); } } public boolean isFocusable() { return true; } protected void onFocus(int direction) { super.onFocus(direction); invalidate(); } protected void onUnfocus() { super.onUnfocus(); invalidate(); } protected boolean navigationClick(int status, int time) { fieldChangeNotify(0); return true; } protected boolean keyChar(char character, int status, int time) { if (character == Keypad.KEY_ENTER) { fieldChangeNotify(0); return true; } return super.keyChar(character, status, time); } }

    Read the article

  • Django: where do I call settings.configure?

    - by RexE
    The Django docs say that I can call settings.configure instead of having a DJANGO_SETTINGS_MODULE. I would like my website's project to do this. In what file should I put the call to settings.configure so that my settings will get configured at the right time? Edit in response to Daniel Roseman's comment: The reason I want to do this is that settings.configure lets you pass in the settings variables as a kwargs dict, e.g. {'INSTALLED_APPS': ..., 'TEMPLATE_DIRS': ..., ...}. This would allow my app's users to specify their settings in a dict, then pass that dict to a function in my app that augments it with certain settings necessary to make my app work, e.g. adding entries to INSTALLED_APPS. What I envision looks like this. Let's call my app "rexe_app". In wsgi.py, my app's users would do: import rexe_app my_settings = {'INSTALLED_APPS': ('a','b'), ...} updated_settings = rexe_app.augment_settings(my_settings) # now updated_settings is {'INSTALLED_APPS': ('a','b','c'), 'SESSION_SAVE_EVERY_REQUEST': True, ...} settings.configure(**updated_settings)

    Read the article

  • Is there a way to check if a div has the same class as an ancestor in jQuery?

    - by T.R.
    I'm looking to dynamically highlight a tab, if it represents the current page. I have: <style> #tabs li{bg-color: white;} body.Page1 #tabs .Page1, body.Page2 #tabs .Page2, body.Page3 #tabs .Page3{bg-color: orange;} </style> <body class="Page1 ADifferentClass"> <ul id="tabs"> <li class="Page1 SomeClass"> <li class="Page2 SomeOtherClass"> <li class="Page3 AnotherClass"> </ul> </body> As you can see, there needs to be CSS for each tab, so adding another page involves modifying both the HTML and the CSS. Is there a simple (DRY) way to check if two divs have the same class already built into jQuery? I ultimately went with this: <script> $(document).ready(function(){ var classRE = /Page\d+/i; var pageType = $('body').attr('className').match(classRE); $('li.'+pageType).addClass('Highlight'); }); </script> <style> #tabs li{bg-color: white;} #tabs li.Highlight{bg-color: orange;} </style>

    Read the article

  • CSS to create curved corner between two elements?

    - by Tauren
    My UI has an unordered list on the left. When a list item is selected, a div appears on the right of it. I'd like to have a curved outer corner where the <li> and the <div> meet. See the white arrow in the image below. To extend the blue <li> to the edge of the <ul>, I'm planning to do something like this: li { right-margin: 2em; border-radius: 8px; } li.active { right-margin: 0; border-bottom-right-radius: 0; border-top-right-radius: 0; } Is there a better way to extend the <li> to the edge of the <ul>? Obviously, I'll include the webkit and mozilla border radius CSS as well. The main thing I'm unsure about is that outer corner underneath the bottom right corner of the active <li>. I have some ideas, but they seem like hacks. Any suggestions? NOTE that the <ul> is indicated in grey, but it would be white in the real design. Also, I'm planning to use Javascript to position the <div> correctly when an <li> is selected.

    Read the article

  • JSF - database character encoding

    - by wheelie
    Hi there, I have a Java Web application using GlassFish 3, JSF2.0 (facelets) and JPA (EclipseLink). The problem I'm facing, is that if I'm saving entities to the database with the update() method, String data loses integrity; '?' is shown instead of some characters. The server, pages and database is/are configured to use UTF-8. After I post form data, the next page shows the data correctly. Furthermore it "seems" in debug that the String property of the current entity stores the correct value too. Dunno if NetBeans debug can be trusted; might be that it decodes correctly, however it's incorrect. Any help would be appreciated, thanks in advance! Daniel

    Read the article

  • Javascript get li values and encode them

    - by bluedaniel
    At the moment I have two (maybe more) unordered lists which are sortable with jquery and ui. The things that work are that the lists are connected, items are draggable, items can be removed and a form that adds to the list. What I need however is a function that gets all the content for li items and json encode them ready to be sent off to some db function, or something. Im new to jquery however and cant find documentation for li items. Hope Ive explained this well. Daniel

    Read the article

  • javascript error of unterminated string

    - by OM The Eternity
    I want pass a parameter of javascript functiona which is a string. This javascript function is a hintbox on mousehover.. and the string i am using is like this: Hemmed Finish: Every side/edge (1/2" to 2") of the banner are folded and glued (special vinyl solution) or heat pressed. This is the most common and best finish option. Stitched Finish: Every side/edge (1" to 2") of the banner are folded in the back and stitched/sewed with white thread. This is not a common option as thread can be seen on the banner. Now in the hintbox on mousehover the above given text has to be display as it is displayed above along with the paragraph break.. But when i pass the above as parameter in that function along with appending some backslashes to recognise some punctuation, iots till gives me javascript error of unterminated string... I am doing this: onMouseover="showhint('Hemmed Finish\: Every side/edge \(1/2\'\' to 2\'\'\) of the banner are folded and glued \(special vinyl solution\) or heat pressed. This is the most common and best finish option.Stitched Finish\: Every side/edge \(1\'\' to 2\'\'\) of the banner are folded in the back and stitched/sewed with white thread. This is not a common option as thread can be seen on the banner', this, event, '250px')" pls could u help me in rectifying the issue...

    Read the article

  • ViewController behaving oddly when pushed on the window

    - by ayazalavi
    I am using multiple controller during launch of an application in app delegate. One controller is for registration and the second controller is tabbar. tabbar was loading fine but when I pushed registration controller on window, contents went up by 20 units and I have good white blank screen at bottom. Therefore I recreated frame of my registration view controller in its viewdidload method and slided it 20 units down. The code is self.view.frame = CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height); and code in my app delegate for launch application was - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if (![self accountExists]) { //code if account does not exists on iphone app database self.registerAccount = [[registerViewController alloc] initWithNibName:@"registerViewController" bundle:nil]; [window addSubview:registerAccount.view]; } else if([self autoLoginForAnyAccount]){ //code for autologin to app } else { self.tabBarController.selectedIndex = 1; self.tabBarController.delegate = self; [window addSubview:tabBarController.view]; } [window makeKeyAndVisible]; return YES; } if anyone knows why there is a white space at bottom when registration controller is pushed then please share it with me.

    Read the article

  • embeding google images search in my website

    - by user1445497
    I want to embed a search box to allow my website users to search images using google images search (not only images in my website, but general images search). However, I don't want an Iframe of something similar, but to present a custom list of the images and links in the format I chose. Ideally, I could get the links to the thumbnails to the in JSON. From what I have found so far, it seems that google no longer supports it's API: https://developers.google.com/image-search/ I am familiar with google custom search, but as far as I know, I can't control exactly how it will be presented. Are there other ways to do it? Thanks, Daniel

    Read the article

  • Upgrade to iPhone 3.0 sdk and now simulator shows blank screen.

    - by NoShitMcGee
    I have an iPhone app that uses an UITabBarController, which contains two UINavigationControllers, each of which in turn contains one or more TableViewControllers (actually, customized UIViewControllers implementing UITableViewDelegate and UITableViewDataSource. ) On launch, it displays the UITabBarController with one of the tableviews displayed. Everything is coded; Interface Builder was NOT used to make any of the UI stuff. It was written in SDK 2. It worked fine in sdk 2. I recently updated to SDK 3.0. In Info, I set the Base SDK setting to iPhone Simulator 3.0. Now, when I launch the application in Simulator, I see only a blank white screen with the status bar at the top. No signs of my app. However, when I exit the app, the missing tableview displays briefly as the exiting animation is playing. Also, on the blank white screen I can still click where the navigation buttons should be and find that, when I exit the app and the missing screen briefly displays, that navigation has taken me to another screen. So the buttons work, and presumably the tableviewcells are there, they just cannot be seen. Has anyone seen anything like this? Does anyone have any idea what is causing it and how I can fix it? I noticed that sample apps, such as SQLiteBooks, seem to work fine when updating to SDK 3.0. My app isn't very much different from SQLiteBooks in terms of technologies used, except that, as I said above, I do not use Interface Builder. Thanks

    Read the article

  • IE textarea wrap bug?

    - by user2227033
    It seems that IE starting from IE7 to IE10 wraps text in the textarea control incorrectly when using \n (or \r\n - doesn't matter - results are the same). Is this a bug in IE or they treat the html standard differently than other browsers - who is right? I have defined: <textarea id="TextArea1" runat="server" style="width: 190px; height: 390px; white-space: normal; word-wrap: normal; overflow: scroll" ></textarea> When I try to add long string like "VeryLongStringEndingWithNewLine\n" by using JavaScript code (obj.value += text;) the text is shown in one line with scroll (this is ok) but added with an additional empty line (\r\n) - why? When I try to add short string like "Short\n" multiple times, again via JavaScript code the text is on the same line (should be on the separate lines because normal wrapping should be applied). Moreover when I do postback then all \r\n's are replaced with spaces (why?) and then text parsed correctly (assuming if I used spaces instead of crlf normal wraping with space only wraps when does not fit in the area). When using FF or Chrome same control behaves correctly - long lines are shown without an additional empty next line, short lines are on the different lines, no replacement with spaces when doing postback. I know I could probably use other options or white space characters, but I feel that above is not correct about IE. Any comments? Mindaugas

    Read the article

  • drawing graphs in php

    - by user434885
    i am using php to generate graphs from arrays. I wish to create multiple graphs on the same page as i need to design a summary report from answers extracted from a database. Currently i am using this code and am only able to get one single graph. what additions to the code do i need to make to get multiple graphs? <?php function draw_graph($values) { // Get the total number of columns we are going to plot $columns = count($values); // Get the height and width of the final image $width = 300; $height = 200; // Set the amount of space between each column $padding = 5; // Get the width of 1 column $column_width = $width / $columns ; // Generate the image variables $im = imagecreate($width,$height); $gray = imagecolorallocate ($im,0xcc,0xcc,0xcc); $gray_lite = imagecolorallocate ($im,0xee,0xee,0xee); $gray_dark = imagecolorallocate ($im,0x7f,0x7f,0x7f); $white = imagecolorallocate ($im,0xff,0xff,0xff); // Fill in the background of the image imagefilledrectangle($im,0,0,$width,$height,$white); $maxv = 0; // Calculate the maximum value we are going to plot for($i=0;$i<$columns;$i++)$maxv = max($values[$i],$maxv); // Now plot each column for($i=0;$i<$columns;$i++) { $column_height = ($height / 100) * (( $values[$i] / $maxv) *100); $x1 = $i*$column_width; $y1 = $height-$column_height; $x2 = (($i+1)*$column_width)-$padding; $y2 = $height; imagefilledrectangle($im,$x1,$y1,$x2,$y2,$gray_dark); } header ("Content-type: image/png"); imagepng($im); imagedestroy($im); } $values = array("23","32","35","57","12"); $values2 = array("123","232","335","157","102"); draw_graph($values2); draw_graph($values);//no output is coming draw_graph($values2);//no output is coming draw_graph($values);//no output is coming ?>

    Read the article

  • How to make DataGrid Row really fully selectable (clicking on non-cell area)

    - by Samuel
    The question might be a little misleading. Here is a screenshot of a DataGrid that has some dummy values (code provided below) Is there a way to make the white area not covered by a cell clickable? My intention: I want to have full row selection. This can be achieved by SelectionUnit="FullRow" which is fine but how can I make the white area implicitly select the entire row without expanding available cells in width and avoiding code behind Here is the repro code: Xaml: <Window x:Class="DGVRowSelectTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" DataContext="{Binding RelativeSource={RelativeSource Self}}"> <DataGrid ItemsSource="{Binding Names}" SelectionMode="Single" SelectionUnit="FullRow" > </DataGrid> </Window> Dummy Code behind of it (just sets the two entries up) using System.Collections.Generic; using System.Windows; namespace DGVRowSelectTest { public partial class MainWindow : Window { private IList<KeyValuePair<string, string>> _names = new List<KeyValuePair<string, string>>{new KeyValuePair<string, string>("A1", "A2"),new KeyValuePair<string, string>("B1","B2")}; public IList<KeyValuePair<string, string>> Names{get { return _names; }set { _names = value; }} public MainWindow() { InitializeComponent(); } } }

    Read the article

  • How to have screen revert to BLACK between pages?

    - by user340667
    0 Hi - I tried out the Background Image Scaling script and with Cybr's update it works like magic. It SCALES the image perfectly. No distortion. BUT, my image isn't "computer friendly". I.e.: Not 1024 X 768 or even close to that. (Heck, my monitor has a wide screen, so it isn't 1024 X 768 either! Is anybody's anymore?) Anyhow, this creates a problem inasmuch as, unless I size the window from the bottom up it ends up with a white "stripe" beneath it. What I would REALLY like for it to do is have that white to be BLACK. My "usual" BG color/text etc. code is like: ""body bgcolor="#000000" text="#fcba1e" link="#0000ff" vlink="#800080" alink="#ff0000"" (Site won't let me add the arrows here.) I've tried inserting this in various places with no success. Any ideas for a workaround would surely be appreciated ! Thanks ! Bill

    Read the article

  • Transparent Select/Option text in IE

    - by Valchris
    I've created the JS fiddle to demonstrate my problem: http://jsfiddle.net/C8NUf/1/ HTML: <select> <option> Test </option> <option> Another Test </option> </select> Style: select { color: transparent; } In chrome, the selected text "test" is properly blanked out by setting the color to transparent, in IE the test is still black. How can I fix this issue in IE? Ideally I want to make this change via JQuery, but that doesn't seem very relevant to the overall problem. Thanks, Daniel

    Read the article

  • Large Product catalog with statistics - alternatives to Sql Server?

    - by Eric P
    I am building UI for a large product catalog (millions of products). I am using Sql Server, FreeText search and ASP.NET MVC. Tables are normalized and indexed. Most queries take less then a second to return. The issue is this. Let's say user does the search by keyword. On search results page I need to display/query for: First 20 matching products (paged, sorted) Total count of matching products for paging List of stores only of matching products List of brands only of matching products List of colors only of matching products Each query takes about .5 to 1 seconds. Altogether it is like 5 seconds. I would like to get the whole page to load under 1 second. There are several approaches: Optimize queries even more. I already spent a lot of time on this one, so not sure it can be pushed further. Load products first, then load the rest of the information using AJAX. More like a workaround. Will need to revise UI. Re-organize data to be more Report friendly. Already aggregated a lot of fields. I checked out several similar sites. For ex. zappos.com. Not only they display the same information as I would like in under 1 second, but they also include statistics (number of results in each category). The following is the search for keyword "white" http://www.zappos.com/white How do sites like zappos, amazon make their results, filters and stats appear almost instantly?

    Read the article

  • how to send the values from TabActivity to Activity?

    - by Anil M H
    In my TabActivity , i'm sending value to other Activity how to do that in this TabActivity how can i send the bundle to other Activity plz tell me how to pass the value to my other ReceivedList Activity plz tell me .... public class TabViewForSendAndRecv extends TabActivity{ private TabActivity tabhost1; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tabviewforsendandrecv); Bundle bundle = getIntent().getExtras(); String stuff = bundle.getString("number"); final TabHost tabHost = getTabHost(); TextView txtTab = new TextView(this); txtTab.setText("Received Alerts"); txtTab.setPadding(8, 9, 8, 9); txtTab.setTextColor(Color.WHITE); txtTab.setTextSize(14); //txtTab.setTypeface(localTypeface1); txtTab.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); TabHost.TabSpec spec; // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("Tab1").setIndicator(txtTab). setContent(new Intent(this, ReceivedList.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)); tabHost.addTab(spec); //tab 2 TextView txtTab1 = new TextView(this); txtTab1.setText("Sent Alerts"); txtTab1.setPadding(8, 9, 8, 9); txtTab1.setTextColor(Color.WHITE); txtTab1.setTextSize(14); //txtTab.setTypeface(localTypeface1); txtTab1.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL); TabHost.TabSpec spec1; // Initialize a TabSpec for each tab and add it to the TabHost spec1 = tabHost.newTabSpec("Tab2").setIndicator(txtTab1).setContent(new Intent(this, SentList.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)); tabHost.addTab(spec1);

    Read the article

  • Increasing understanding of validating a string with PHP string functions

    - by user1554264
    I've just started attempts to validate data in PHP and I'm trying to understand this concept better. I was expecting the string passed as an argument to the $data parameter for the test_input() function to be formatted by the following PHP functions. trim() to remove white space from the end of the string stripslashes() to return a string with backslashes stripped off htmlspecialchars() to convert special characters to HTML entities The issue is that the string that I am echoing at the end of the function is not being formatted in the way I desire at all. In fact it looks exactly the same when I run this code on my server - no white space removed, the backslash is not stripped and no special characters converted to HTML entities. My question is have I gone about this in the wrong approach? Should I be creating the variable called $santised_input on 3 separate lines with each of the functions trim(), stripslashes() and htmlspecialchars()? By my understanding surely I am overwriting the value of the $santised_input variable each time I recreate it on a new line of code. Therefore the trim() and stripslashes() string functions will never be executed. What I am trying to achieve is using the "$santised_input" variable to run all of these PHP string functions when the $data argument is passed to my test_input() function. In other words can these string functions be chained together so that I only need to create $santised_input once? <?php function test_input($data) { $santised_input = trim($data); $santised_input = stripslashes($data); $santised_input = htmlspecialchars($data); echo $santised_input; } test_input("%22%3E%3Cscript%3Ealert('hacked')%3C/script%3E\ "); //Does not output desired result "&quot;&gt;&lt;script&gt;alert('hacked')&lt;/script&gt;" ?>

    Read the article

  • GDI+ not clearing my window on repaint for vista

    - by Michael
    on WM_PAINT i do the following: //RectF mNameRect; //WCHAR* mName; //HWND mWin; // this is the window handle { PAINTSTRUCT ps; HDC hdc = BeginPaint(mWin, &ps); Graphics g(hdc); g.Clear(Color::White); StringFormat stringForm; stringForm.SetLineAlignment(StringAlignmentCenter); stringForm.SetAlignment(StringAlignmentCenter); // set the rectangle to the size of the whole window mNameRect.Width = static_cast<float>(size.cx); mNameRect.Height = static_cast<float>(size.cy); g.DrawString(mName, -1, &mNameFont, mNameRect, &stringForm, &mNameBrush); EndPaint(mWin, &ps); } In XP this works fine, the mName is displayed in the middle of the window. However on Vista the text doesn't move, it stays in its location no matter how I resize the window. the g.Clear(Color::White) doesn't seem to do any difference. The text doesn't even change position when the window is hidden behind another window and on focus needs to be repainted again. How do I make mName change position in Vista?

    Read the article

  • How to set only the first cell of a UITableView to a different color?

    - by Ted
    I use cellForRowAtIndexPath like here: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell == nil) cell = [self getCellContentView:CellIdentifier]; UILabel *lbl = (UILabel*)[cell.contentView viewWithTag:1]; for (UITableViewCell *c in [tbl visibleCells]) { // UITableViewCell *cell2 = [tbl cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; UILabel *lbl = (UILabel*)[c.contentView viewWithTag:1]; lbl.textColor = [UIColor redColor]; } if([tbl indexPathForCell:cell].section==0) lbl.textColor = [UIColor whiteColor]; UILabel *lblTemp1 = (UILabel *)[cell viewWithTag:1]; UILabel *lblTemp2 = (UILabel *)[cell viewWithTag:2]; //First get the dictionary object lblTemp1.text = @"test!"; lblTemp2.text = @"testing more"; NSLog(@"%@",[tbl indexPathForCell:cell]); return cell; } But is still makes some of my cells white instead of gray. How can I change only the first item in the row to white?

    Read the article

  • calling a trim method in actionscript 2.0

    - by user151013
    Hi I Got a notnull function for a text field as below private function valStringNotNull( val:String ) :Boolean { if ( String(val).length <= 0 ) { _errorCode = "StringNull"; return false; } _errorCode = "NoError"; return true; } and this function is being called here var pCnt:Number = 0; _validateParams[pCnt++] = { type: "notNull", input: win.firstNameInput , isSendData:true, dataName:"firstName"}; _validateParams[pCnt++] = { type: "notNull", input: win.lastNameInput, isSendData:true, dataName:"lastName"}; _validateParams[pCnt++] = { type: "noValidation", input: roleCombo, isSendData:true, dataName:"role" }; Selection.setFocus(win.firstNameInput); and for the not null I defined this way private function validateCases ( param:Object ) :Boolean { _errorObj = param.input || param.input1; switch( param.type ) { case "notNull": return valStringNotNull( param.input.text ); break; } } but as you see as I defined the length should be greater than zero its taking even a space as an input and displaying blank white space in my text field so I got a trim function as below public function ltrim(input:String):String { var size:Number = input.length; for(var i:Number = 0; i < size; i++) { if(input.charCodeAt(i) > 32) { return input.substring(i); } } return ""; } and I need to call this trim function before my not null function so that it trims off all the leftside white space but as I am very new to flash can some one help me how to keep this trim function before the notnull function.Can some one please help me with this please

    Read the article

  • How can I define an irregular area of the screen and find the closest point to the mouse in that area?

    - by JonathonG
    I'm looking for a method to define an area of the screen that the mouse cannot leave. I have been directed by rob mayoff, the answerer of this question, that I can use a Quartz Event Tap to detect mouse events. This puts me part of the way to the solution to THIS question. I need to define an irregular area of the screen, not just a rectangle, that the mouse cannot leave. I have been researching this and the only idea I can come up with is using a bitmap to define the irregular area, as it will be very oddly shaped. However, I am open to solutions other than using a bitmap. Since this must be done on a Mac, I've determined that I will have to use objective C / Cocoa . I need to know how to define the area and, equally importantly, how to find the closest point in the area to the mouse (so that I can move the mouse to it if the mouse tries to move outside of the area). This is similar to what the restricted area will look like: [edit:] Okay, I've come up with part of the answer to this. If I can do a basic (light-weight) point collision detection on the image mask, I can use a simple algorithm to detect the closest point to the mouse on the black area of the image. I could do this by calculating distance between a pre-defined point (P) inside the black area of the image and the target mouse position (T), taking the midpoint (M), then checking if the midpoint is inside or outside of the shape (black or white, respectively). If M is inside the shape, then move the P to M, otherwise move T to the M, continuously recalculate this until the distance between T and P is 1 pixel or less, then move the mouse to the final calculated position. All of that being said, I still need some way to test the position of the mouse against that same position on the bitmap (assume the bitmap is the same resolution as the monitor), and check if that point is black or white. All of this needs to be done in the background, without this application actually having focus, or the bitmap being visible... is this possible?

    Read the article

  • jQuery menu animation

    - by bomortensen
    Hi Stackoverflow, I'm building a website where I'm using jQuery to animate a horizontal tabbed menu. What I want to achieve can be seen here: / link removed / If you hover/mouseover the "Link 1" tab, you'll see that a white div is expanding. Each of the tab menu items are a styled li-tag. What I want to do is, that when you hover/mouseover i.e. the "Link 2" tab, the white div contracts and then expands again with content related to "Link 2" instead of "Link 1". Also, the "Link 1" tab should be expanded by default (i.e. when you just entered the site) Does any of you jQuery ninjas out there know how to do this? What I currently have is this: <script type="text/javascript"> $(document).ready(function(){ var $div = $('#divtest'); var height = $div.height(); $div.hide().css({ height : 0 }); $('#forside').hover(function () { if ($div.is(':visible')) { $div.animate({ height: 0 }, { duration: 200, complete: function () { $div.hide(); } }); } else { $div.show().animate({ height : height }, { duration: 200 }); } return false; }); }); </script> Do I need to have 4 different div's which expands/contracts for every mouseover? If i'm not being clear about what my problem is, please say so and I'll try to elaborate :) Thanks in advance!

    Read the article

  • Layering Images & Click to Choose Using Javascript

    - by rneal
    So I'm making a gallery of fabrics and backgrounds for letters for a fraternity/sorority store in my college's town. If you don't know what I'm talking about, this is a fabric letter. You can see how it has a white outline (background) and a red inside (foreground). WELL, I want to make it so you can change both the foreground and background, simply by clicking it's similar image. This is what I have so far <script type="text/javascript">// <![CDATA[ function changeImage(filename) { document.mainimage.src = filename; }// ]]></script> with these for each fabrics: <a href="javascript:changeImage('/wp-content/themes/collegiateconnectionbg/images/fabrics/foregrounds/37.jpg')"> <img src="/wp-content/themes/collegiateconnectionbg/images/fabrics/foregrounds/37.jpg" alt="" width="100px" height="50px" /></a> I really like how this works, but it's only good for one layer. Is there anyway I can add a layer below it, but still make it show at the top of the page? I know I'll have to use photoshop and transparency for both options, thats no problem, but I wanted to make sure I can do this before I start creating 600+ images. I know I can play with z-index and css, but since I'm using wordpress the one example I read about here wasn't working or I didn't completely understand it, and messed up my entire page. Also here's my tester webpage to see the current code in work. (if you click the navy&white stars image, you can see a very rough makeshift "A") Thanks in advance!

    Read the article

  • Change row table color with javaScript

    - by Slim Mils
    I try to change the background of rows in my table with javaScript but it's not working. This is my code. However I tried to create my table with html and it's work. P.S : I want to use webkit. Help please. Code : var table = document.getElementById("tab"); var rowCount = table.rows.length; for(var i=0;i<6;i++) { row = table.insertRow(rowCount); row.id = "row"+i; cell1 = row.insertCell(0); var content = document.createElement("output"); content.innerHTML = i ; cell1.appendChild(content); rowCount++; } $(document).ready(function(){ $('td').each(function(i) { $('#tab').on('click', '#row'+i, function(){ document.getElementById("row"+i).style.background = 'white'; //alert(i); }); }); //example2 $('#td1').on('click', function(){ document.getElementById("td1").style.background = 'white'; }); });

    Read the article

< Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >