Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 54/584 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • using jquery, how do you change the image on hover inside of a div

    - by oo
    i have the following jquery code to replace an image when you hover over with the mouse but it doesn't seem to be working. Can anyone find anything wrong with this code below. $(function() { $("div.delete img") .mouseover(function() { $(this).attr("src", "../../images/comment-hover-del.png"); }) .mouseout(function() { $(this).attr("src", "../../images/comment-del.png"); }); }); and this is my html: <div class="delete" id="26"><img src="../../images/comment-del.png" border="0"></div>

    Read the article

  • show the list of usernames inside a div

    - by Mr_Green
    I am new to jQuery. In my project, I created one Class User in which the code is as shown below: static ConcurrentDictionary<string, User> _users = new ConcurrentDictionary<string, User>(); // // some function to add values to _users list // public List<User> GetConnectedUsers() { return _users.Values.ToList(); } I want to show this list of values in div #showUsernames. How to do this by using jQuery? I tried the below which is not showing anything /*display your contacts*/ $('#showUsernames').append(function(){ chat.server.getConnectedUsers(); }); where chat.server(signalr) calls the server-side code(Chat class).. I think the solution has nothing to do with signalr. If the above description is not enough then you can go through my code here

    Read the article

  • Using scope, defined in parent model, inside it's child (STI pattern)

    - by Anton
    I implement a class hierarchy using STI pattern class A scope :aaa, where([someField]:[someValue]) end class B < A end The problem is that when I try to call something like: B.limit(5).aaa => SELECT "[table]".* FROM "[table]" WHERE "[table]"."type" IN ('A') AND ([someField] = [someValue]) LIMIT 5 So I am getting 5 objects of type A, which satisfies scope :aaa But I need to do the same with rows where type = "B" Is there any way to use scopes from parent, without redifinning it in childs in STI pattern? Thanks in advance EDITED I just discussed it with my frind and he showed me one important thing. A in not the root class of STI. IN fact whole hierarchy looks like class O < ActiveRecord::Base end class A < O scope ..... ..... end class B < A end maybe the reason is in hierarchy itself?...

    Read the article

  • getJSON triggered from a button inside a form

    - by nav
    Hi, I'm having trouble understanding why I have to place the button triggering the getJSON method outside of the form for the request to work. If the button is placed within the form then the getJSON method returns no results. The code bascially makes a XHR request on clicking the Submit button, based on the value selected. I have replicated the issue here: http://jsfiddle.net/z6caj/ Many Thanks,

    Read the article

  • Using getElementById inside user control

    - by toraan
    I have a usercontrol that hides a div when a button is clicked. <asp:LinkButton ID="lnkbtn" OnClientClick="ShowHide(); return false;" runat="server" /> <div id="popupPage" style="display:none;"> </div> function ShowHideGotoPopUp() { var ob = document.getElementById("popupPage"); if (ob.style.display == "none") ob.style.display = "block"; else ob.style.display = "none" } There is a problem when I place on page more then 1 usercontrol, all controls has div with same id = popupPage.

    Read the article

  • Center text inside a circle on a canvas

    - by jax
    I have the coordinates of the center of a circle where I need to draw some text. The circle may be larger or smaller depending on the attributes I have specified. I have set the center horizontally using mTextBrush.setTextAlign(Align.CENTER);. The problem is that I can't figure out a way to center the text vertically. (See "Draw the counter" below) //Text Brush setup mTextBrush = new Paint(Paint.ANTI_ALIAS_FLAG); mTextBrush.setColor(Color.BLACK); mTextBrush.setTextSize(1/10*mMaxSize); mTextBrush.setTextAlign(Align.CENTER); mTextBrush.setStyle(Paint.Style.STROKE); private void drawSmallTimer(Canvas canvas) { //Variable cache int radiusLocalCache = this.mRadius; int cx = radiusLocalCache+(radiusLocalCache/2); int cy = radiusLocalCache-(radiusLocalCache/2); int radius = radiusLocalCache/3; //Draw the background circle canvas.drawCircle(cx, cy, radius, mBackgroundBrush); //Draw the outline stroke canvas.drawCircle(cx, cy, radius, mStrokeBrush); //Draw the counter String text = String.valueOf(mCounter); canvas.drawText(text, cx, cy, mTextBrush); }

    Read the article

  • Passing an address inside a WordPress post to a Google Map elsewhere on the Page

    - by ael_ecurai
    Background: My client is building their own WordPress site (using a purchased feature-rich theme), and I'm modifying a child theme as necessary to achieve customizations she wants. The theme comes with a Page template that includes a full-width Google Map across the top, which pulls its marker from a single address set within the Theme Options. It's meant to be used for one main "Contact Us" page. The client's business has several locations, and she wants each location's page to include such a map. (Example linked below.) It seems that the ideal solution would be the ability to specify an address within a shortcode in the Post, and have that set the map marker. Here's how the theme makes the map (where $mapAddress is the address from the Theme Options): <?php $mapAddress = ot_get_option( 'map_address' ); $mapHeight = ot_get_option( 'map_height' ); $mapContent = ot_get_option( 'map_content' ); ?> <section id="block-map-wrapper"> <div id="block-map" class="clearfix"> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script> <script> jQuery(document).ready(function(){ // Map Options var mapOptions = { zoom: 15, scrollwheel: false, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.TOP_LEFT }, mapTypeControl: true, scaleControl: false, panControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; // The Map Object var map = new google.maps.Map(document.getElementById("map"), mapOptions); var address = ""; var geocoder = new google.maps.Geocoder(); geocoder.geocode({ "address" : "<?php echo $mapAddress; ?>" }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { address = results[0].geometry.location; map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ position: address, map: map, clickable: true, animation: google.maps.Animation.DROP }); var infowindow = new google.maps.InfoWindow({ content: "<?php echo $mapContent; ?>" }); google.maps.event.addListener(marker, "click", function() { infowindow.open(map, marker); }); } }); }); </script> <div id="map" class = "map" style = "width: 100%; height: <?php echo $mapHeight; ?>px"></div> </div><!-- #block-map --> <div class="shadow-bottom"></div> </section><!-- #block-map-wrapper --> Here's a test page using a custom Page template I've created. Right now it's using the same map code as above. I've tried creating a shortcode that takes an address attribute and sets it as $mapAddress, but that didn't work. I believe it's because the map is already loaded by the time the Loop gets parsed. How can I tell Maps to "come back" to the post to get the proper address? My specialty lies in HTML & CSS, but Javascript befuddles me fairly easily, so please be explicit when explaining implementation. Bonus: A further goal is to have the locations' parent Page also include such a map, but have multiple markers representing the multiple locations. When taking more than one location, Google Maps only accepts latitude/longitude. I don't want my client to be concerned with coordinates, so I know there's got to be something I can do with the geocoding service so she can just input a list of addresses instead (into the same, or similar, shortcode solution developed for my main question). But I am extra-clueless about how to do that.

    Read the article

  • HTML tag closes when inside a condition

    - by Malharhak
    I'm having a little problem with jade. Here is the following code : each user in users - if (user.valid == 1) tr(style="color:green;") - else tr(style="color:red;") td = user.mail td = user.lastIp td = user.token td = user.valid My problem is that the tds are created only in the else case. if the if (user.valid == 1) is true, then it creates an empty tr. Is there a way I can create my tr with this condition, and then only fill them ? Thanks :)

    Read the article

  • Calculating percent of votes inside mysql statement.

    - by Beck
    UPDATE polls_options SET `votes`=`votes`+1, `percent`=ROUND((`votes`+1) / (SELECT voters FROM polls WHERE poll_id=? LIMIT 1) * 100,1) WHERE option_id=? AND poll_id=? Don't have table data yet, to test it properly. :) And by the way, in what type % integers should be stored in database? Thanks for the help!

    Read the article

  • Javascript object binding problem inside of function prototype definitions

    - by Arion
    Hi all, I am trying to figure out the right place to bind a function prototype to be called later. The full code of the example can be found here: http://www.iprosites.com/jso/ My javascript example is very basic: function Obj(width, height){ this.width = width; this.height = height; } Obj.prototype.test = function(){ var xhr=init(); xhr.open('GET', '?ajax=test', true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); xhr.onreadystatechange = function() { if (xhr.responseText == '403') { window.location.reload(false); } if (xhr.readyState == 4 && xhr.status == 200) { this.response = parseResponse(xhr.responseText); document.getElementById('resp').innerHTML = this.response.return_value; this.doAnotherAction(); } }; xhr.send(); } Obj.prototype.doAnotherAction = function(){ alert('Another Action Done'); } var myo = new Obj(4, 6); If you try to run myo.test() in Firebug, you will get the "this.doAnotherAction is not a function" response. The 2 support functions init() and parseResponse() can be found in the test.js link if you wish to view them, but should not be too relevant to this problem. I've affirmed that this.doAnotherAction() thinks "this" is the XMLHttpResponse object as expected from an instanceof test. Can anyone help with some insight on direction with binding? Everything I've tried seems not to work! I do use Mootools, although the library is not present in this example. Thanks in advance, Arion

    Read the article

  • Opening an Excel worksheet inside a Webbrowser.

    - by rabindrarai
    Hi, I have opened a workbook using WebBrowser. However, it opens the first worksheet in the workbook whereas I would like to open a worksheet based on a name that I provide. Following is the code I used to open the workbook: public void OpenFile(string filename) { // Check the file exists if (!System.IO.File.Exists(filename)) throw new Exception(); m_ExcelFileName = filename; // Load the workbook in the WebBrowser control this.wbMain.Navigate(filename, false); } I would like to thank you in advance for trying to help me.

    Read the article

  • Reset SQL variable inside SELECT statement

    - by Jason McCreary
    I am trying to number some rows on a bridge table with a single UPDATE/SELECT statement using a counter variable @row. For example: UPDATE teamrank JOIN (SELECT @row := @row + 1 AS position, name FROM members) USING(teamID, memberID) SET rank = position Is something like this possible or do I need to create a cursor? If it helps, I am using MySQL 5.

    Read the article

  • Expanders inside listbox leaving blank space on collapse

    - by siz
    We have a rather complex UI that is presenting some problems for us. I have a ListBox that contains a set of DataItems. The DataTemplate for each item is an Expander. The header is text, the content of the Expander is a ListBox. The ListBox contains SubDataItems. The DataTemplate for each SubDataItem is an Expander. Here is a simplified XAML in which I reproduce the issue: <ListBox ItemsSource="{Binding Items}"> <ListBox.ItemTemplate> <DataTemplate> <Expander Header="{Binding Header}"> <ListBox ItemsSource="{Binding SubItems}"> <ListBox.ItemTemplate> <DataTemplate> <Expander Header="{Binding SubHeader}"> <Grid Height="40"> <TextBlock Text="{Binding SubText}" /> </Grid> </Expander> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Expander> </DataTemplate> </ListBox.ItemTemplate> </ListBox> There is a problem with how the layout is produced. If any Expander corresponding to the SubDataItem is expanded, the ListBoxItem containing this ListBox (the Expander.Content in the parent DataTemplate) correctly requests more space. So I can expand all SubDataItems and correctly see my data. However, when I collapse, the space I previously asked to expand, remains blank, instead of being reclaimed by the ListBoxItem. This is a problem because if I have say 10 SubDataItems and happen to expand all of them at the same time and then collapse, there is a significant amount of white space wasting my real estate. How can I force WPF to resize the ListBoxItem to the correct state?

    Read the article

  • Selecting a value from multiple dictionaries inside an enumeration

    - by johaanfaust
    If I have an enumeration of dictionaries IEnumerable<IDictionary<string, float>> enumeration can I perform a Linq query on it so that I can select by a value from each dictionary in the enumeration using the same key? I can do this in a loop: float f; foreach (var dictionary in enumeration) { if (dictionary.TryGetValue("some key", out f)) { Console.WriteLine(f); } } (The eventual plan is to compare the performance of the query verses the equivalent nested looping statements (the enumeration itself is formed from either another query or an equivalent set of loops).)

    Read the article

  • odd behavior setting timeouts inside a function with global references in javascript

    - by Pablo
    Here is the the function and the globals: $note_instance = Array(); $note_count = 0; function create(text){ count = $note_count++; time = 5000; $note_instance[count] = $notifications.notify("create", text); setTimeout(function(){ $note_instance[count].close() }, time); } The function simply opens a notification, a sets a timeout to close it in 5 seconds. so if i call this create("Good Note 1"); create("Good Note 2"); create("Good Note 3"); Ecah note should close 5 seconds from their creation, however always and only the last note closes, in this case "Good Note 3". Each note object has its own entry in the the $note_instance global array so the timeouts should no be overwriting themselves. What am i missing here folks? Thanks in advance

    Read the article

  • Trigger function inside a usercontrol from a page

    - by diver-d
    Hi there, I have created a usercontrol to capture education details, it contains 5 textboxes and an functionto insert that values into my db. I have added the usercontrol 5 times to a page. I have a button on my aspx page which I want to be able to click and call the function to insert the values. Can anyone suggest how I can do this?

    Read the article

  • GetValue on static field inside nested classes.

    - by Sir Gallahad
    Hi... I have the following class declared. I need to retreive the class structure and the static values without instanciate it. public MyClass() { public static string field = "Value"; public nestedClass() { public static string nestedField = "NestedValue"; } } I've successfuly used GetFields and GetNestedType to recover the class structure and GetValue(null) works fine on field, but not on nestedField. Let me sample: var fi = typeof(MyClass).GetField("field", BindingFlags.Public | BindingFlags.Static); var nt = typeof(MyClass).GetNestedType("nestedClass", BindingFlags.Public); var nfi = nt.GetField("nestedField", BindingFlags.Public | BindingFlags.Static); // All the above references are detected correctly var value = fi.GetValue(null); // until here everything works fine. value == "Value" var nestedValue = nfi.GetValue(null); // this one does not work!! Anyone knows why the last line does not work and how to work around? Thanks.

    Read the article

  • calling plugin inside ajax call function problem

    - by zurna
    I pull categories of one section from an XML. Problem is, pulled categories need to recognize tab plugin so I tried to add tab plugin to CategoryName variable. But it is not working. I get the following error. Error: CategoryName.find is not a function Source File: http://www.refinethetaste.com/FLPM/ Line: 23 Test website: http://www.refinethetaste.com/FLPM/ $.ajax({ dataType: "xml", url: "/FLPM/content/home/index.cs.asp?Process=ViewVCategories", success: function(xml) { $(xml).find('row').each(function(){ var id = $(this).attr('id'); var CategoryName = $(this).find('CategoryName').text(); $("<div class='tab fleft'><a href='http://www.refinethetaste.com/FLPM/content/home/index.cs.asp?Process=ViewVideos&CATEGORYID="+ id +"'>"+ CategoryName + "</a></div>").appendTo("#VCategories"); CategoryName.find("div.row-title .red").tabs("div.panes > div"); }); } }); pulled categories displayed here: <div class="row-title clear" id="VCategories"> categories xml <rows> - <row id="1"> <CategoryName>Nation</CategoryName> </row> - <row id="2"> <CategoryName>Politics</CategoryName> </row> - <row id="3"> <CategoryName>Health</CategoryName> </row> - <row id="4"> <CategoryName>Business</CategoryName> </row> - <row id="5"> <CategoryName>Culture</CategoryName> </row> </rows> </div>

    Read the article

  • How to pass an int value on UIButton click inside UITableView

    - by Toran Billups
    So I have a view controller with a single UITableView that shows a string to the user. But I needed a way to have the user select this object by id using a normal UIButton so I added it as a subview and the click event works as expected. The issue is this - how can I pass an int value to this click event? I've tried using attributes of the button like button.tag or button.accessibilityhint without much success. How do the professionals pass an int value like this? Also it's important that I can get the actual [x intValue] from the int later in the process. A while back I thought I could do this with a simple NSLog(@"the actual selected hat was %d", [obj.idValue intValue]); But this doesn't appear to work (any idea how I can pull the actual int value directly from the variable?). The working code I have is below - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } if ([self.hats count] > 0) { Hat* obj = [self.hats objectAtIndex: [indexPath row]]; NSMutableString* fullName = [[NSMutableString alloc] init]; [fullName appendFormat:@"%@", obj.name]; [fullName appendFormat:@" %@", obj.type]; cell.textLabel.text = fullName; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; //add the button to subview hack UIButton* button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(50, 5, 50, 25); [button setTitle:@"Select" forState:UIControlStateNormal]; button.backgroundColor = [UIColor clearColor]; button.adjustsImageWhenHighlighted = YES; button.tag = obj.idValue; //this is my current hack to add the id but no dice :( [button addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside]; [cell.contentView addSubview:button]; //hack } return cell; } - (void)action:(id)sender { int* hatId = ((UIButton *)sender).tag; //try to pull the id value I added above ... //do something w/ the hatId }

    Read the article

  • show tweets inside div from an asynchronous loop

    - by ak_47
    Am trying to laod tweets into a div after looping them from yahoo placemaker. They are loading on the div but the information shown by them is placemaker's last result. This is the code.. function getLocation(user, date, profile_img, text,url) { var templates = []; templates[0] = '<div><div></div><h2 class="firstHeading">'+user+'</h2><div>'+text+'</div><div><p><a href="' + url + '"target="_blank">'+url+'</a></p></div><p>Date Posted- '+date+'</p></div>'; templates[1] = '<table width="320" border="0"><tr><td class="user" colspan="2" rowspan="1">'+user+'</td></tr><tr><td width="45"><a href="'+profile_img+'"><img src="'+profile_img+'" width="55" height="50"/></a></td><td width="186">'+text+'<p><a href="' + url + '"target="_blank">'+url+'</a></p></td></tr></table><hr>'; templates[2] = '<div><div></div><h2 class="firstHeading">'+user+'</h2><div>'+text+'</div><div><p><a href="' + url + '"target="_blank">'+url+'</a></p></div><p>Date Posted- '+date+'</p></div>'; templates[3] = '<table width="320" border="0"><tr><td class="user" colspan="2" rowspan="1">'+user+'</td></tr><tr><td width="45"><a href="'+profile_img+'"><img src="'+profile_img+'" width="55" height="50"/></a></td><td width="186">'+text+'<p><a href="' + url + '"target="_blank">'+url+'</a></p></td></tr></table><hr>'; var geocoder = new google.maps.Geocoder(); Placemaker.getPlaces(text, function (o) { console.log(o); if (!$.isArray(o.match)) { var latitude = o.match.place.centroid.latitude; var longitude = o.match.place.centroid.longitude; var myLatLng = new google.maps.LatLng(latitude, longitude); var marker = new google.maps.Marker({ icon: profile_img, title: user, map: map, position: myLatLng }); var infowindow = new google.maps.InfoWindow({ content: templates[0].replace('user',user).replace('text',text).replace('url',url).replace('date',date) }); var $tweet = $(templates[1].replace('%user',user).replace(/%profile_img/g,profile_img).replace('%text',text).replace('%url',url)); $('#user-banner').css("visibility","visible");$('#news-banner').css("visibility","visible"); $('#news-tweets').css("overflow","scroll").append($tweet); function openInfoWindow() { infowindow.open(map, marker); } google.maps.event.addListener(marker, 'click', openInfoWindow); $tweet.find(".user").on('click', openInfoWindow); bounds.extend(myLatLng); } }); }

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >