Search Results

Search found 763 results on 31 pages for 'nav'.

Page 3/31 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • iphone Dev - activity indicator with NSThread not working on Nav controller table view

    - by Frames84
    I really can't get this to work, basically when my JSON feeds loads I want the indicator to show, then hide when it's stopped. It loads top level menu items 1st "Publishing, Broadcasting, Marketing Services", then when Broadcasting is selected it loads a feed using the JSON framework hosted on Google. Round this load I call startIndicator and stopIndicator using the NSThread. Have I missed something? @implementation GeneralNewsTableViewController @synthesize dataList; @synthesize generalNewsDetailViewController; @synthesize atLevel; -(void) startIndicator { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc ] init ]; [(UIActivityIndicatorView *)[self navigationItem].rightBarButtonItem.customView startAnimating]; [pool release]; } -(void) stopIndicator { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc ] init ]; [(UIActivityIndicatorView *)[self navigationItem].rightBarButtonItem.customView stopAnimating]; [pool release]; } - (void)viewDidLoad { NSMutableArray *checker = self.dataList; if(checker == nil) { self.title = NSLocalizedString(@"General1",@"General News"); NSMutableArray *array = [[NSArray alloc] initWithObjects:@"Publishing", @"Broadcasting",@"Marketing Services",nil]; self.dataList = [array retain]; self.atLevel = @"level1"; [array release]; } UIActivityIndicatorView * activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; //set the initial property [activityIndicator stopAnimating]; [activityIndicator hidesWhenStopped]; //Create an instance of Bar button item with custome view which is of activity indicator UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithCustomView:activityIndicator]; //Set the bar button the navigation bar [self navigationItem].rightBarButtonItem = barButton; //Memory clean up [activityIndicator release]; [barButton release]; [super viewDidLoad]; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *level = self.atLevel; if([level isEqualToString:@"level2"]) { return 70.0f; } else { return 40.0f; } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *FirstLevelCell = @"FirstLevelCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:FirstLevelCell]; if(cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:FirstLevelCell] autorelease]; } NSInteger row = [indexPath row]; NSString *level = self.atLevel; if([level isEqualToString:@"level2"]) { NSMutableArray *stream = [self.dataList objectAtIndex:row]; NSString *newsTitle = [stream valueForKey:@"title"]; if( ![newsTitle isKindOfClass:[NSString class]] ) { cell.textLabel.text = @""; } else { cell.textLabel.text = [stream valueForKey:@"title"]; } cell.textLabel.numberOfLines = 2; cell.textLabel.font =[UIFont systemFontOfSize:10]; cell.detailTextLabel.numberOfLines = 1; cell.detailTextLabel.font= [UIFont systemFontOfSize:8]; cell.detailTextLabel.text = [stream valueForKey:@"created"]; NSData *imageURL = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.how-do.co.uk/images/stories/Cimex.jpg"]]; UIImage *newsImage = [[UIImage alloc] initWithData:imageURL]; cell.imageView.image = newsImage; [imageURL release]; [newsImage release]; } else { cell.textLabel.text = [dataList objectAtIndex:row]; } return cell; } - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; NSMutableString *levelType = (NSMutableString *) [dataList objectAtIndex:row]; if(![levelType isKindOfClass:[NSString class]]) { if(self.generalNewsDetailViewController == nil) { GeneralNewsDetailViewController *generalDetail = [[GeneralNewsDetailViewController alloc] initWithNibName:@"GeneralNewsDetailView" bundle:nil]; self.generalNewsDetailViewController = generalDetail; [generalDetail release]; } NSDictionary *stream = [self.dataList objectAtIndex:row]; NSString *newsTitle = [stream valueForKey:@"title"]; if( ![newsTitle isKindOfClass:[NSString class]] ) { generalNewsDetailViewController.newsTitle = @""; } else { generalNewsDetailViewController.newsTitle =[stream valueForKey:@"title"]; } generalNewsDetailViewController.newsId = [stream valueForKey:@"id"]; generalNewsDetailViewController.fullText = [stream valueForKey:@"fulltext"]; generalNewsDetailViewController.newsImage = [stream valueForKey:@"images"]; generalNewsDetailViewController.created = [stream valueForKey:@"created"]; HowDo_v1AppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.generalNewsNavController pushViewController:self.generalNewsDetailViewController animated:YES]; } else { GeneralNewsTableViewController *generalSubDetail = [[GeneralNewsTableViewController alloc] initWithNibName:@"GeneralNewsTableView" bundle:nil]; NSMutableArray *array; NSString *titleSelected = (NSString *) [dataList objectAtIndex:row]; if([titleSelected isEqualToString:@"Publishing"]) { generalSubDetail.title = @"Publishing news detail"; array = [[NSArray alloc] initWithObjects:@"pub News1", @"pub News2",@"pub News3",nil]; generalSubDetail.atLevel = @"level1"; } else if ([titleSelected isEqualToString:@"Broadcasting"]) { generalSubDetail.title = @"Broadcasting news detail"; /// START [self performSelectorOnMainThread:@selector(startIndicator) withObject:nil waitUntilDone:YES]; if(jSONDataAccessWrapper == nil) { jSONDataAccessWrapper = [JSON_DataAccess_Wrapper alloc]; } array = [jSONDataAccessWrapper downloadJSONFeed]; [self performSelectorOnMainThread:@selector(stopIndicator) withObject:nil waitUntilDone:YES]; generalSubDetail.atLevel = @"level2"; } else if ([titleSelected isEqualToString:@"Marketing Services"]) { generalSubDetail.title = @"Marketing Services news detail"; array = [[NSArray alloc] initWithObjects:@"Marketing News1", @"Marketing News2",@"Marketing News3",nil]; generalSubDetail.atLevel = @"level1"; } generalSubDetail.dataList = array; [self.navigationController pushViewController:generalSubDetail animated:YES]; [titleSelected release]; } } - (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section //- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSIndexPath *) section { return [self.dataList count]; } Cheers for any feedback Frames

    Read the article

  • dropdown under a nav button css/html

    - by MannfromReno
    I have a navcontainer with buttons in the container. I need to make a dropdown list for only one of the buttons. How would this be accomplished with CSS/HTML. Here is my code: HTML: <div id="navcontainer"> <a href="/home.html" class="button" style="width: 115px">About Us</a> <a href="/quote.html" class="button" style="width: 170px">Request a Quote</a> <a href="/affiliates.html" class="button" style="width: 115px">Affiliates</a> <a href="/pricing.html" class="button" style="width: 170px">Pricing & Plans</a> <a href="/addservices.html" class="button" style="width: 190px">Additional Services</a> <a href="/service.html" class="button" style="width: 165px">Service Details</a> <a href="/watering.html" class="button" style="width: 108px">Watering</a> </div> CSS: #navcontainer { float: right; width: 1040px; height: 45px; text-align: center; line-height: 45px; color: #fff; margin-bottom: 6px; } .button { text-align: center; background: #226426; color: #fff; width: 100px; height: 45px; float: left; text-decoration: none; font-family: Arial, sans-serif; font-size: 15px; font-weight: bold; border-right: solid 1px #91b293; border-top: solid 1px #91b293; border-bottom: solid 1px #91b293; } Do I need to make this into a ul or can I keep it as is, and just add a dropdown to the Services button? Thanks for your help.

    Read the article

  • Some nav buttons working, others not

    - by boz
    the buttons within my submenue movie clip don't work. the one's not within a submenu work fine. my code validates and i'm not getting any errors any idea on what else i should be checking? ///this one doesn't work//// aboutSub.bio.addEventListener(MouseEvent.CLICK, goBio); function goBio(evtObj:MouseEvent) { gotoAndStop("bio"); } /// this one works//// home.addEventListener(MouseEvent.CLICK, gohome); function gohome(evtObj:MouseEvent) { gotoAndStop("home"); }

    Read the article

  • UINavigationBar unresponsive after canceling a UITableView search in nav controller in tab bar in a popover

    - by Mark
    Ok, this is an odd one and I can reproduce it with a new project easily. Here is the setup: I have a UISplitViewController. In the left side I have a UITabBarController. In this tab bar controller I have two UINavigationControllers. In the navigation controllers I have UITableViewControllers. These table views have search bars on them. Ok, what happens with this setup is that if I'm in portrait mode and bring up this view in the popover and I start a search in one of the table views and cancel it, the navigation bar becomes unresponsive. That is, the "back" button as well as the right side button cannot be clicked. If I do the exact same thing in landscape mode so we are not in a popover, this doesn't happen. The navigation bar stays responsive. So, the problem only seems to happen inside a popover. I've also noticed that if I do the search but click on an item in the search results which ends up loading something into the "detail view" of the split view and dismissing the popover, and then come back to the popover and then click the Cancel button for the search, the navigation bar is responsive. My application is a universal app and uses the same tab bar controller in the iPhone interface and it works there without this issue. As I mentioned above, I can easily reproduce this with a new project. Here are the steps if you want to try it out yourself: start new project - split view create new UITableViewController class (i named TableViewController) uncomment out the viewDidLoad method as well as the rightBarButtonItem line in viewDidLoad (so we will have an Edit button in the navigation bar) enter any values you want to return from numberOfSectioinsInTableView and numberOfRowsInSection methods open MainWindow.xib and do the following: please note that you will need to be viewing the xib in the middle "view mode" so you can expand the contents of the items drag a Tab Bar Controller into the xib to replace the Navigation Controller item drag a Navigation Controller into the xib as another item under the Tab Bar Controller delete the other two view controllers that are under the Tab Bar Controller (so, now our tab bar has just the one navigation controller on it) inside the navigation controller, drag in a Table View Controller and use it to replace the View Controller (Root View Controller) change the class of the new Table View Controller to the class created above (TableViewController for me) double-click on the Table View under the new Table View Controller to open it up (will be displayed in the tab bar inside the split view controller) drag a "Search Bar and Search Display" onto the table view save the xib run the project in simulator while in portrait mode, click on the Root List button to bring up popover notice the Edit button is clickable click in the Search box - we go into search mode click the Cancel button to exit search mode notice the Edit button no longer works So, can anyone help me figure out why this is happening? Thanks, Mark

    Read the article

  • SL3 Nav framework + MVVM ligh

    - by Murari
    Hi All, Thanks for taking time to read through my question. Any guidance is really appreciated. I am using SL3 Navigation framework in my LOB application. I m currently using MVVM Light as the framework guidance. I have a datagrid consisting of employees and when the "user" clicks on "employee id link" in the datagrid, i am transferring the user to "Edit Page". I would like to transfer the "employee id" as query parameter to "edit page". The issue here is: I can access the query parameter in the EditStaffView.xaml.cs - which i don't want to do. protected override void OnNavigatedTo(NavigationEventArgs e) { if (this.NavigationContext.QueryString.ContainsKey("staffcode")) { string title = this.NavigationContext.QueryString["staffcode"]; } } I would like to retrieve the query parameter in my viewmodel and based on the query parameter, i will perform certain operations. When the constructor is called I would like the "view" to pass the staffid as shown below public EditStaffViewModel(int staffId) { LoadData(staffId); } I am constructing my hyperlink buttons in the datagrid dyanmically as shown below: staffListingModel.HyperlinkNavigationUri = string.Format("{0}{1}", NavigationUri.DataEntryEditStaff,"?staffcode={" + staffListingModel.StaffCode + "}"); and XAML looks HyperlinkButton Content="{Binding StaffCode,Mode=TwoWay}" NavigateUri="{Binding HyperlinkNavigationUri}" HyperlinkButton Any idea how to do this ?? Thanks for the help. Murari

    Read the article

  • iPhone: Can't animate contentInset while animating Nav Bar show/hide

    - by Cuzog
    In my app, I have a table view. When the user clicks a button, a UIView overlays part of that table view. It's essentially a partial modal. That table view is intentionally still scrollable while that modal is active. To allow the user to scroll to the bottom of the table view, I change the contentInset and scrollIndicatorInsets values to adjust for the smaller area above the modal. When the modal is taken away, I reset those inset values. The problem is that when the user has scrolled to the bottom of the newly adjusted inset and then dismisses the modal, the table view jumps abruptly to a new scroll position because the inset is changed instantly. I would like to animate it so there is a transition, but the beginAnimation/commitAnimations methods aren't affecting it for some reason. Edit: More info. I found the conflict. When presenting the modal, I also hide the navigation bar. The navigation bar natively animates the table view up and down as it shows and hides. When I stop animating the navigation bar, the inset animation works fine. Does anyone know what I can do to work around this conflict? Do I have to wait for the navigation bar animation to finish before adjusting the inset? If so, how to I hook onto that? Any help is greatly appreciated! The relevant code from the table view controller is here: - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalOpened) name:@"ModalStartedOpening" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalDismissed) name:@"ModalStartedClosing" object:nil]; [super viewDidLoad]; } - (void)modalOpened { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 201, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 201, 0); [UIView commitAnimations]; } - (void)modalDismissed { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, 0); [UIView commitAnimations]; }

    Read the article

  • Rolling (slot machine style) nav bar in Flash or SwishMax

    - by decbrad
    Just wondering if anyone has an ideas on how this rolling (slot machine style) navigation bar was created. Maybe there's a Flash / SwishMax tutorial online somewhere? This effect is very hard to replicate because it animates very quickly onscreen, so any assistance to get me started would be great Here's a sample of what I am trying to achieve: http://osc4.template-help.com/wt_28854/menu.swf?button=1 Thanks in advance, Decbrad

    Read the article

  • JQuery Tabbed Nav Menu and PHP Forms Question?

    - by SlAcKeR
    I'm using a JQuery Tabbed Menu which holds different types of forms and when I select a different form located under a different tab and submit the form the tab will jump to the default tab instead of the current tab the form is located in. I was wondering how would I go about fixing this so that when the form is submitted the current tab is still selected, is it the JQuery or PHP problem? Here is the JQuery. $(document).ready(function() { //When page loads... $(".form-content").hide(); //Hide all content var firstMenu = $("#home-menu ul li:first"); firstMenu.show(); firstMenu.find("a").addClass("selected-link"); //Activate first tab $(".form-content:first").show(); //Show first tab content //On Click Event $("#home-menu ul li").click(function() { $("#home-menu ul li a").removeClass("selected-link"); //Remove any "selected-link" class $(this).find("a").addClass("selected-link"); //Add "selected-link" class to selected tab $(".form-content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the selected-link tab + content $(activeTab).fadeIn(); //Fade in the selected-link ID content return false; }); });

    Read the article

  • Leftover Nav Bar in Landscape View

    - by Rob Bonner
    Hello, I am working to force a view into landscape mode, and have picked up all kinds of cool tips to make this happen, but am stuck on one item that is left on the screen. I have my XIB file laid out in landscape, and in my code I create the view controller normally: RedeemViewController *aViewController = [[RedeemViewController alloc] initWithNibName:@"RedeemViewController" bundle:nil]; aViewController.hidesBottomBarWhenPushed = YES; aViewController.wantsFullScreenLayout = YES; [[self navigationController] pushViewController:aViewController animated:YES]; Inside the controller viewDidLoad I complete the following: [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight]; [[self navigationController] setNavigationBarHidden:YES animated:YES]; [UIView beginAnimations:@"View Flip" context:nil]; [UIView setAnimationDuration:.75]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; if (self.interfaceOrientation == UIInterfaceOrientationPortrait) { self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90)); self.view.bounds = CGRectMake(0.0, 0.0, 480, 320); } [UIView commitAnimations]; What I end up with is a perfectly rotated view, with a grey vertical bar on the left side (see pic). So to the question, how do I get rid of the bar? Edit: I am pretty sure this is the navigation bar that is not being hidden. This is a duplicate of another post, with some modified code, the other question was being answered with the bug.

    Read the article

  • detecting when nav controller popped to root

    - by phil swenson
    Here is my code: SignupController* signupController = [[SignupController alloc] initWithNibName:@"SignupController" bundle:nil]; [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; self.navigationController.title = @"MyNavController"; [self.navigationController pushViewController:signupController animated:YES]; [signupController release]; Unfortunately for me calling pushViewController is not synchronous, so the next line ([signupController release]) is executed immediately. I need to detect hen the signupController has popped back to the root so I can take the data from the signup controller and do a registration or login. Any ideas? Thanks

    Read the article

  • Sortie de Microsoft Dynamics NAV 2009 R2, le nouvel ERP de Microsoft pour les PME propose un outil de visualisation très simple et innovant

    Microsoft Dynamics NAV 2009 R2 Le nouvel ERP de Microsoft pour les PME propose un outil de visualisation simple et innovant La gamme des solutions d'entreprise de Microsoft est très complète. Tout comme pour ses licences d'utilisation, il est très facile de s'y perdre. Mais l'avantage de cette gamme réside dans le fait qu'elle couvre nombre de besoins des enterprises. Sa gamme d'ERP (ou PGI pour Progiciel de gestion intégré) ne fait pas exception. Issu de la gamme Dynamics (qui compte également deux CRM), le dernier ERP de Microsoft Dynamics NAV 2009 R2 est la version qui vise les entreprises de 20 à 1...

    Read the article

  • DIV not sizing correctly when elements inside are bigger?

    - by Ben Dauphinee
    Tried removing the overflow hidden, but that does not seem to fix it. Suggestions? Relevent HTML and problem illustration here: http://mgc.selfip.com/bugscreen01.jpg Relevent CSS #nav{padding: 5px 0px; overflow: hidden; background-color: #7af;} ul#nav{white-space: nowrap;} #nav li{display: inline; list-style-type: none;} #nav li a{padding: 5px 10px;} #nav a{font-family: "Adobe Caslon Pro", "Hoefler Text", Georgia, Garamond, Times, serif; font-size: 14pt; font-variant: small-caps;} #nav a:link, #nav a:visited{color: #fff; text-decoration: none;} #nav a:hover, #nav a:focus{color: #fff; background: #91db24;}

    Read the article

  • Padding on A nested in LI in DIV does not size div correctly. Suggestions?

    - by Ben Dauphinee
    Tried removing the overflow hidden, but that does not seem to fix it. Suggestions? Relevent HTML and problem illustration here: http://mgc.selfip.com/bugscreen01.jpg Relevent CSS #nav{padding: 5px 0px; overflow: hidden; background-color: #7af;} ul#nav{white-space: nowrap;} #nav li{display: inline; list-style-type: none;} #nav li a{padding: 5px 10px;} #nav a{font-family: "Adobe Caslon Pro", "Hoefler Text", Georgia, Garamond, Times, serif; font-size: 14pt; font-variant: small-caps;} #nav a:link, #nav a:visited{color: #fff; text-decoration: none;} #nav a:hover, #nav a:focus{color: #fff; background: #91db24;}

    Read the article

  • Suckerfish Menu Not Working. Nested UL not displaying block

    - by Brett
    I'm going out of my mind with this one. I'm trying to build a suckerfish css drop down menu. I have the first level working ok but I can't get the nested ul (under the Glossary tab) to display in block format and show my a background color. I've been at this for three days and I'm about to go crazy. If anyone can help I'd really appreciate it. You can see it here: www.brettlockhart.com/blast/ body { min-width:640px; margin:0px; padding:0px 40px 0px 40px; background-color:#eee; } /*Nav One styles*/ nav#navOne ul { width:100%; min-width:640px; height:25px; margin:0px auto; padding:0px; background-image:url(/blast/images/navOneBg.png); border-radius:0px 0px 8px 8px; text-align:right; float:right; } nav#navOne ul li { position:relative; display:inline; margin: 0px 0px 0px 10px auto; padding:3px 0px; border-left:1px #0b4c8f solid; line-height:23px; } nav#navOne ul li:last-child { margin-right:10px; } .arrowDown { margin: auto; font-family:Tahoma, Geneva, sans-serif; font-size:.7em; color:#FFF; padding: 0px 5px 0px 0px; } nav#navOne ul li a { margin: 0px auto; padding: 4px 10px 4px 15px; font-family:Tahoma, Geneva, sans-serif; font-size:.7em; color:#FFF; border-left:1px #5d9ee0 solid; text-decoration:none; line-height:23px; } /*Nav One rollover*/ nav#navOne ul li ul { display:none; background-image:none; } nav#navOne ul li:hover ul { display:block !important; } nav#navOne ul li:hover nav#navOne ul li ul li { background-color:#69C !important; left:0px; top:26px; z-index:10; } h1 { float:left; width:158px; text-indent:-9999px; background-image:url(/blast/images/logo.png); background-repeat:no-repeat; } #search { float:right; width:280px; margin:0px; padding:0px; } /*Nav Two styles*/ nav#navTwo h3 { display:inline; } nav#navTwo ul { width:100%; height:50px; margin:0 auto; padding:0px; border:1px solid red; clear:both; } nav#navTwo ul li { display:inline; border: 1px solid green; margin-top:20px; } <header> <nav id="navOne"> <ul> <li><a href="#">Sign In</a></li> <li><a href="#">Register</a></li> <li><a href="#">Print Page</a></li> <li id="glossary"><a href="#">Glossary</a> <ul> <li><a href="#">Item Placeholder</a></li> <li><a href="#">Item Placeholder</a></li> <li><a href="#">Item Placeholder</a></li> <li><a href="#">Item Placeholder</a></li> <li><a href="#">Item Placeholder</a></li> <li><a href="#">Item Placeholder</a></li> </ul> </li> <li><a href="#">Text Size: A A A</a></li> <li><a href="#">Select Your Location</a> <span class="arrowDown">&#x2C5;</span></li> </ul> </nav><!--/navOne--> <h1>Logo</h1> <div id="search"> <form action="?" method="get"> <fieldset> <input type="text" id="searchField"> <input type="submit" id="searchSubmit" value="Submit"> Search:<label for="radioHere">here</label> <input type="radio" id="radioHere" name="here" value="here"> <label for="radioWeb">the web</label> <input type="radio" id="radioWeb" name="the web" value="the web"> </fieldset> </form> </div><!--/search--> <nav id="navTwo"> <ul> <li><h3>Residential:</h3></li> <li>TV</li> <li>Internet</li> <li>Phone</li> <li>Pricing</li> <li class="navTwoSelected">Music</li> <li>Order</li> <li>Billing</li> <li>Support</li> <li>|</li> <li>Business</li> <li>About Us</li> </ul> </nav><!--/navTwo--> <nav id="navThree"> <ul> <li>Today</li> <li>Watch</li> <li>Surf</li> <li>Play</li> <li class="navThreeSelected">Listen</li> <li>Learn</li> <li>Local</li> </ul> <h3>Tools:</h3> <ul> <li>Webmail</li> <li>Account</li> <li>Billing</li> <li>Order Services</li> </ul> </nav><!--/navThree--> <nav id="navFour"> <h3>Your are here:</h3> <ul id="breadcrumbs"> <li>Residential ></li> <li>My Place ></li> <li>Listen ></li> <li class="currentPage">Music</li> </ul> </nav><!--/navFour--> </header>

    Read the article

  • Adapting a HTML/CSS dropdown menu to multi-level

    - by Adam Nygate
    Ive been trying to make the original dropdown into multi level for a site im working on. All of my attempts have failed (. For some reason i can only do "margin-right" to align the elements, and this causes some problems. I think it has something to do with the position attribute. Here is my HTML: <ol id="nav"> <li><a href="index.php">Home</a></li> <li class="dropdown_alignedLeft"> <a href="">Products</a> <ul><li class="dropdown_alignedRight"> <a href="">iPoP</a> <ul style="margin-right:-400px; top:0px;-webkit-border-top-right-radius: 5px;border-top-right-radius: 5px;-moz-border-radius-topright: 5px;"><li><a href="customers.php?category=ipop">iPoP - Network Solutions for Vessels</a></li></ul><li class="dropdown_alignedRight"> <a href="">Cameras</a> <ul style="margin-right:-400px; top:0px;-webkit-border-top-right-radius: 5px;border-top-right-radius: 5px;-moz-border-radius-topright: 5px;"><li><a href="customers.php?category=icam">iCam 501 Ultra - Intrinsically Safe Digital Camera with Flash</a></li></ul><li class="dropdown_alignedRight"> <a href="">BNWAS</a> <ul style="margin-right:-400px; top:0px;-webkit-border-top-right-radius: 5px;border-top-right-radius: 5px;-moz-border-radius-topright: 5px;"><li><a href="customers.php?category=bnwas">BNWAS - Bridge Navigation Watch Alarm System</a></li></ul><li class="dropdown_alignedRight"> <a href="">Lighting</a> <ul style="margin-right:-400px; top:0px;-webkit-border-top-right-radius: 5px;border-top-right-radius: 5px;-moz-border-radius-topright: 5px;"><li><a href="customers.php?category=peli">Peli 2690 - Intrinsically Safe LED Head Lamp</a></li></ul><li class="dropdown_alignedRight"> <a href="">Communication</a> <ul style="margin-right:-400px; top:0px;-webkit-border-top-right-radius: 5px;border-top-right-radius: 5px;-moz-border-radius-topright: 5px;"><li><a href="customers.php?category=handy">Ex-Handy 06 - Intrinsically Safe Cell Phone</a></li></ul> </ul> <li class="dropdown_alignedLeft"> <a href="">Customers</a> <ul> <li><a href="customers.php?category=maritime">Maritime</a></li> <li><a href="customers.php?category=non">Non-Maritime</a></li> <li class="dropdown_lastItem"><a href="customers.php?category=organizations">Regulatory Organizations</a></li> </ul> <li><a href="order.php">Product Enquiry</a></li> <li><a href="contact.php">Contact Us</a></li> <li class="dropdown_alignedLeft"> <a href="">Company</a> <ul> <!-- <li><a href="">About Us</a></li> --> <li><a href="newsandpr.php?category=News">News</a></li> <li class="dropdown_lastItem"><a href="newsandpr.php?category=Press Release">Press Releases</a></li> </ul> </ol> And my CSS: #nav { float:right; margin:15px 0 0; } #nav li { float:left; } #nav li a { display:block; font-family:"PT Sans","Helvetica Neue",Arial,sans-serif; font-size:16px; text-decoration:none; color:#2B95C8; padding:10px 20px 20px; } .dropdown_alignedLeft,.dropdown_alignedRight { position:relative; } #nav .dropdown_alignedLeft>a,#nav .dropdown_alignedRight>a { background:url(../images/dropdown_arrow_blue.png) no-repeat top right; padding:10px 30px 20px 20px; } #nav .dropdown_alignedLeft:hover>a,#nav .dropdown_alignedRight:hover>a { -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px; -moz-border-radius-bottomright:0; -moz-border-radius-bottomleft:0; -webkit-border-top-left-radius:5px; -webkit-border-top-right-radius:5px; -webkit-border-bottom-right-radius:0; -webkit-border-bottom-left-radius:0; border-top-left-radius:5px; border-top-right-radius:5px; border-bottom-right-radius:0; border-bottom-left-radius:0; color:#FFF; background:#2378A1 url(../images/dropdown_arrow_blue.png) no-repeat bottom right; } .dropdown_alignedLeft ul,.dropdown_alignedRight ul { display:none; } #nav .dropdown_alignedLeft:hover>ul,#nav .dropdown_alignedRight:hover>ul { display:block; z-index:100; position:absolute; top:50px; -moz-border-radius-topleft:0; -moz-border-radius-topright:0; -moz-border-radius-bottomright:5px; -moz-border-radius-bottomleft:5px; -webkit-border-top-left-radius:0; -webkit-border-top-right-radius:0; -webkit-border-bottom-right-radius:5px; -webkit-border-bottom-left-radius:5px; border-top-left-radius:0; border-top-right-radius:0; border-bottom-right-radius:5px; border-bottom-left-radius:5px; background:#2378A1; padding:0 0 6px; } #nav .dropdown_alignedRight:hover>ul { top:50px; right:0; text-align:right; } #nav li ul li { float:none; border-bottom:1px dashed #2B95C8; margin:0 20px; } #nav li ul li.dropdown_innerTitle { border:none; font-family:"Helvetica Neue",Arial,sans-serif; font-size:15px; white-space:nowrap; color:#C8DDE7; margin:10px 20px 0; padding:10px 0; } #nav li ul li.dropdown_lastItem { border:none; } #nav li ul li a { font-family:"Helvetica Neue",Arial,sans-serif; font-size:13px; color:#FFF; white-space:nowrap; padding:10px 0 9px; } #nav>li:hover>a,#nav li .current_page { color:#2378A1; background:url(../images/current_page_arrow_blue.png) no-repeat center bottom; } #nav li ul li a:hover { color: #C8DDE7; } For a live version of the menu, please go here: JSFiddle - Live Menu

    Read the article

  • Background-image toggle using jquery

    - by Jon
    Hi all, bit of a jquery rookie here trying to get something to work. Basically I have a div with a class "nav" and inside that div is a nav list. I want to change the background-image of "nav" when hovering over an item in the navlist, so I made this unsuccesful effort: enter code here $(function(){ $("li#hover-first").mouseover(function(){ $("div.nav").removeClass("nav").addClass("navbg"); .mouseout(function(){$("div.nav").removeClass("navbg").addClass("nav"); }); So the idea is, once the first li item is hovered over, the div with classname "nav" has it's class removed and has "navbg" added (which has the alternate background image). Obviously this isn't working, so any help would be greatly appreciated...thanks.

    Read the article

  • jquery ui tabs close button beneath the text

    - by Pradyut Bhattacharya
    Hi I m using jquery ui tabs and i m using them with the function of dynamically closing them. the example page here where clicking on the link 'add tab' leads to adding of tabs in the tabs panel... now in firefox the close buttons are displayed beneath the text of the tab which is leading to garbled text in the tab panel or the body of the tabs like other browsers how can i display it in same line the css i m using is .ui-tabs { padding: .20em; zoom: 1; } .ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; height:27px; } .ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; font-size:63.5%; } .ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; font: 62.5%; } .ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background:black; color:white; font-size: 12px; } .ui-tabs .ui-tabs-hide { display: none !important; font: 62.5%; } #tabs .ui-tabs-nav li a:hover { float: left; text-decoration: none; padding: .5em 1em; background-color: #868472; } #tabs-profile .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; font-size:75%; } Please help thanks Pradyut India

    Read the article

  • Mobile Friendly Websites with CSS Media Queries

    - by dwahlin
    In a previous post the concept of CSS media queries was introduced and I discussed the fundamentals of how they can be used to target different screen sizes. I showed how they could be used to convert a 3-column wide page into a more vertical view of data that displays better on devices such as an iPhone:     In this post I'll provide an additional look at how CSS media queries can be used to mobile-enable a sample site called "Widget Masters" without having to change any server-side code or HTML code. The site that will be discussed is shown next:     This site has some of the standard items shown in most websites today including a title area, menu bar, and sections where data is displayed. Without including CSS media queries the site is readable but has to be zoomed out to see everything on a mobile device, cuts-off some of the menu items, and requires horizontal scrolling to get to additional content. The following image shows what the site looks like on an iPhone. While the site works on mobile devices it's definitely not optimized for mobile.     Let's take a look at how CSS media queries can be used to override existing styles in the site based on different screen widths. Adding CSS Media Queries into a Site The Widget Masters Website relies on standard CSS combined with HTML5 elements to provide the layout shown earlier. For example, to layout the menu bar shown at the top of the page the nav element is used as shown next. A standard div element could certainly be used as well if desired.   <nav> <ul class="clearfix"> <li><a href="#home">Home</a></li> <li><a href="#products">Products</a></li> <li><a href="#aboutus">About Us</a></li> <li><a href="#contactus">Contact Us</a></li> <li><a href="#store">Store</a></li> </ul> </nav>   This HTML is combined with the CSS shown next to add a CSS3 gradient, handle the horizontal orientation, and add some general hover effects.   nav { width: 100%; } nav ul { border-radius: 6px; height: 40px; width: 100%; margin: 0; padding: 0; background: rgb(125,126,125); /* Old browsers */ background: -moz-linear-gradient(top, rgba(125,126,125,1) 0%, rgba(14,14,14,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(125,126,125,1)), color-stop(100%,rgba(14,14,14,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(125,126,125,1) 0%, rgba(14,14,14,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(125,126,125,1) 0%, rgba(14,14,14,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(125,126,125,1) 0%, rgba(14,14,14,1) 100%); /* IE10+ */ background: linear-gradient(top, rgba(125,126,125,1) 0%, rgba(14,14,14,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7d7e7d', endColorstr='#0e0e0e',GradientType=0 ); /* IE6-9 */ } nav ul > li { list-style: none; float: left; margin: 0; padding: 0; } nav ul > li:first-child { margin-left: 8px; } nav ul > li > a { color: #ccc; text-decoration: none; line-height: 2.8em; font-size: 0.95em; font-weight: bold; padding: 8px 25px 7px 25px; font-family: Arial, Helvetica, sans-serif; } nav ul > li a:hover { background-color: rgba(0, 0, 0, 0.1); color: #fff; }   When mobile devices hit the site the layout of the menu items needs to be adjusted so that they're all visible without having to swipe left or right to get to them. This type of modification can be accomplished using CSS media queries by targeting specific screen sizes. To start, a media query can be added into the site's CSS file as shown next: @media screen and (max-width:320px) { /* CSS style overrides for this screen width go here */ } This media query targets screens that have a maximum width of 320 pixels. Additional types of queries can also be added – refer to my previous post for more details as well as resources that can be used to test media queries in different devices. In that post I emphasize (and I'll emphasize again) that CSS media queries only modify the overall layout and look and feel of a site. They don't optimize the site as far as the size of the images or content sent to the device which is important to keep in mind. To make the navigation menu more accessible on devices such as an iPhone or Android the CSS shown next can be used. This code changes the height of the menu from 40 pixels to 100%, takes off the li element floats, changes the line-height, and changes the margins.   @media screen and (max-width:320px) { nav ul { height: 100%; } nav ul > li { float: none; } nav ul > li a { line-height: 1.5em; } nav ul > li:first-child { margin-left: 0px; } /* Additional CSS overrides go here */ }   The following image shows an example of what the menu look like when run on a device with a width of 320 pixels:   Mobile devices with a maximum width of 480 pixels need different CSS styles applied since they have 160 additional pixels of width. This can be done by adding a new CSS media query into the stylesheet as shown next. Looking through the CSS you'll see that only a minimal override is added to adjust the padding of anchor tags since the menu fits by default in this screen width.   @media screen and (max-width: 480px) { nav ul > li > a { padding: 8px 10px 7px 10px; } }   Running the site on a device with 480 pixels results in the menu shown next being rendered. Notice that the space between the menu items is much smaller compared to what was shown when the main site loads in a standard browser.     In addition to modifying the menu, the 3 horizontal content sections shown earlier can be changed from a horizontal layout to a vertical layout so that they look good on a variety of smaller mobile devices and are easier to navigate by end users. The HTML5 article and section elements are used as containers for the 3 sections in the site as shown next:   <article class="clearfix"> <section id="info"> <header>Why Choose Us?</header> <br /> <img id="mainImage" src="Images/ArticleImage.png" title="Article Image" /> <p> Post emensos insuperabilis expeditionis eventus languentibus partium animis, quas periculorum varietas fregerat et laborum, nondum tubarum cessante clangore vel milite locato per stationes hibernas. </p> </section> <section id="products"> <header>Products</header> <br /> <img id="gearsImage" src="Images/Gears.png" title="Article Image" /> <p> <ul> <li>Widget 1</li> <li>Widget 2</li> <li>Widget 3</li> <li>Widget 4</li> <li>Widget 5</li> </ul> </p> </section> <section id="FAQ"> <header>FAQ</header> <br /> <img id="faqImage" src="Images/faq.png" title="Article Image" /> <p> <ul> <li>FAQ 1</li> <li>FAQ 2</li> <li>FAQ 3</li> <li>FAQ 4</li> <li>FAQ 5</li> </ul> </p> </section> </article>   To force the sections into a vertical layout for smaller mobile devices the CSS styles shown next can be added into the media queries targeting 320 pixel and 480 pixel widths. Styles to target the display size of the images in each section are also included. It's important to note that the original image is still being downloaded from the server and isn't being optimized in any way for the mobile device. It's certainly possible for the CSS to include URL information for a mobile-optimized image if desired. @media screen and (max-width:320px) { section { float: none; width: 97%; margin: 0px; padding: 5px; } #wrapper { padding: 5px; width: 96%; } #mainImage, #gearsImage, #faqImage { width: 100%; height: 100px; } } @media screen and (max-width: 480px) { section { float: none; width: 98%; margin: 0px 0px 10px 0px; padding: 5px; } article > section:last-child { margin-right: 0px; float: none; } #bottomSection { width: 99%; } #wrapper { padding: 5px; width: 96%; } #mainImage, #gearsImage, #faqImage { width: 100%; height: 100px; } }   The following images show the site rendered on an iPhone with the CSS media queries in place. Each of the sections now displays vertically making it much easier for the user to access them. Images inside of each section also scale appropriately to fit properly.     CSS media queries provide a great way to override default styles in a website and target devices with different resolutions. In this post you've seen how CSS media queries can be used to convert a standard browser-based site into a site that is more accessible to mobile users. Although much more can be done to optimize sites for mobile, CSS media queries provide a nice starting point if you don't have the time or resources to create mobile-specific versions of sites.

    Read the article

  • Jquery Flexslider - can't see navigational images (manualControl)

    - by Kim Thomas
    I've spent a lot of time looking at the post on 3/13/12 re: manual controls, but isn't getting me all the way there...probably because I don't know jquery. Sorry, newbie on board. I'm trying to get the right/left arrows to show, as well as the 1, 2, 3...at the bottom. They are there, I see the lists on Firebug, just don't know how to add them to the "hook" (?) so they appear. Here is the code I have in header: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script src="jquery.flexslider.js"></script> <script type="text/javascript" charset="utf-8"> $(window).load(function() { $('.flexslider').flexslider({ animation: "slide", slideshow: false, controlNav: true, manualControls: ".flex-control-nav li a", controlsContainer: ".flex-container" }); }); </script> Here is my html: <div class="flex-container"> <div class="flexslider"> <ul class="slides"> <li><img src="images/tah_home.jpg" alt="taylor art house home page" width="600" height="320"/> <p class="flex-caption">Taylor Art House Home Page</p></li> <li><img src="images/tah_blog.jpg" alt="taylor art house blog page" width="600" height="320" /> <p class="flex-caption">We created a blog that fits seemlessly into Taylor Art House's look</p></li> <li><img src="images/tah_artwork_page.jpg" alt="taylor art house art page" width="600" height="320" /> <p class="flex-caption">One of Taylor Art House's gallery pages, using a Wordpress plugin</p></li> <li><img src="images/tah_arch_portfolio.jpg" alt="jon taylor architecture portfolio page" width="600" height="320" /> <p class="flex-caption">We created links to toggle from TAH to Jon Taylor Architecture</p></li> </ul> </div><!--end flexsider--> </div><!--end flex-container--> Here is the Flexslider CSS: /* * jQuery FlexSlider v1.8 * http://www.woothemes.com/flexslider/ * * Copyright 2012 WooThemes * Free to use under the MIT license. * http://www.opensource.org/licenses/mit-license.php */ /* Browser Resets */ .flex-container a:active, .flexslider a:active, .flex-container a:focus, .flexslider a:focus {outline: none;} .slides, .flex-control-nav, .flex-direction-nav {margin: 0; padding: 0; list-style: none;} /* FlexSlider Necessary Styles *********************************/ .flexslider { width: 100%; margin: 0; padding: 0; } .flexslider .slides > li { display: none; -webkit-backface-visibility: hidden; } /* Hide the slides before the JS is loaded. Avoids image jumping */ .flexslider .slides img { max-width: 100%; display: block; } .flex-pauseplay span { text-transform: capitalize; } /* Clearfix for the .slides element */ .slides:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } html[xmlns] .slides { display: block; } * html .slides { height: 1%; } /* No JavaScript Fallback */ /* If you are not using another script, such as Modernizr, make sure you * include js that eliminates this class on page load */ .no-js .slides > li:first-child { display: block; } /* FlexSlider Default Theme *********************************/ .flexslider { width: 600px; background: #fff; border: 4px solid #999; position: relative; margin: 30px 0; -webkit-border-radius: 5px; -moz-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; zoom: 1; } .flexslider .slides { zoom: 1; } .flexslider .slides > li { position: relative; } /* Suggested container for "Slide" animation setups. Can replace this with your own, if you wish */ .flex-container { zoom: 1; position: relative; margin-left:100px; } /* Caption style */ /* IE rgba() hack */ .flex-caption { background:none; -ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000); zoom: 1; } .flex-caption { width: 96%; padding: 2%; margin: 0; position: absolute; left: 0; bottom: 0; background: rgba(0,0,0,.3); color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,.3); font-size: 14px; line-height: 18px; } /* Direction Nav */ .flex-direction-nav { height: 0; } .flex-direction-nav li a { width: 52px; height: 52px; margin: -13px 0 0; display: block; background: url(theme/bg_direction_nav.png) no-repeat; position: absolute; top: 50%; cursor: pointer; text-indent: -999em; } .flex-direction-nav li .next { background-position: -52px 0; right: -21px; } .flex-direction-nav li .prev { left: -20px; } .flex-direction-nav li .disabled { opacity: .3; filter:alpha(opacity=30); cursor: default; } /* Control Nav */ .flex-control-nav { width: 100%; position: absolute; bottom: -30px; text-align: center; } .flex-control-nav li { margin: 0 0 0 5px; display: inline-block; zoom: 1; *display: inline; } .flex-control-nav li:first-child { margin: 0; } .flex-control-nav li a { width: 13px; height: 13px; display: block; background: url(theme/bg_control_nav.png) no-repeat; cursor: pointer; text-indent: -999em; } .flex-control-nav li a:hover { background-position: 0 -13px; } .flex-control-nav li a.active { background-position: 0 -26px; cursor: default; } Here is how it appears in Firebug: <div class="flex-container"> <div class="flexslider" style="overflow: hidden;"> <ul class="slides" style="width: 1200%; margin-left: -1800px;"> <li class="clone" style="width: 600px; float: left; display: block;"> <li style="width: 600px; float: left; display: block;"> <li style="width: 600px; float: left; display: block;"> <li style="width: 600px; float: left; display: block;"> <li style="width: 600px; float: left; display: block;"> <li class="clone" style="width: 600px; float: left; display: block;"> </ul> </div> <ol class="flex-control-nav"> <li> <a class="">1</a> </li> <li> <li> <li> </ol> <ul class="flex-direction-nav"> <li> <a class="prev" href="#">Previous</a> </li> <li> <a class="next" href="#">Next</a> </li> </ul> </div> Finally, here is a link to the jsFiddle file (I saw someone wanted that in other flexslider post): http://jsfiddle.net/kthms/Wxmsp/ Link to page: http://www.kajortdesigns.com/tah.php I've tried every combo of class from the CSS in the manualControl: "", but I'm just guessing. If anyone can help this newbie out, I would be very appreciative. Explicit instructions are always appreciated.

    Read the article

  • Multiple Jquery Cycle Slideshows with their own Navs

    - by daveredfern
    Hello, I am using the Jquery cycle plugin (http://malsup.com/jquery/cycle/) on a blog listing page. There are multiple slideshows which work fine but I'd like each on the have their own previous and next. Because these are blog posts it is difficult to sign unique IDs or classes. I currently have:- $('.article .gallery').cycle({ next: '.viewmore .left', prev: '.viewmore .right', timeout:0 }); I have tried the following but doesn't work. It gives you a better idea of what I am looking for:- $('.article .gallery').cycle({ next: $(this).next('.viewmore .left'), prev: $(this).next('.viewmore .right'), timeout:0 }); Can anyone help me? Thanks in advance. Dave.

    Read the article

  • matching an element's class to another element's ID, or *part* of another element's ID

    - by shecky
    hello again Such a simple concept but I'm struggling to express it ... apologies in advance for my verbosity. I have a container div with a class, e.g., ; I want to use that class to do two things: add a class (e.g., 'active') to the nav element whose ID matches the class of div#container (e.g., #nav-primary li# apples) add the same class to another element if part of this element's ID matches the class of #container (e.g., div#secondary-apples) I assume there's an .each() loop to check the primary nav's list items' IDs, and to check the div IDs of the secondary nav ... though the latter needs to have its prefix trimmed ... or should I say more simply if the secondary nav div IDs contain the class of div#container? I've tried a few variations of something like this: <script type="text/javascript"> $(document).ready(function() { $('#nav-primary li').each(function(){ var containerClass = $('#container').attr('class'); var secondaryID = $('#nav-primary li').attr('id'); // something like if ('#nav-primary li id' == (containerClass) { } // or should I first store a variable of the LI's ID and do something like this: if ( secondaryID == containerClass ) { } // and for the trickier part, how do I filter/trim the secondary nav div IDs, something like this: var secondaryNavID = $('#aux-left div[id ... something here to strip the 'secondary-' bit ... ]'); }); // end each }); // end doc.ready.func </script> The markup is, e.g.: ... ... ... ... ... ... ... Many thanks in advance for any suggestions, svs

    Read the article

  • How to return function in document ready?

    - by FatDogMark
    I don't know if it is possible to do this, like I have 2 js files. The first Js File: var news_pos, about_pos, services_pos, clients_pos; function define_pos(){ var $top_slides=$('#top_slides'), $mid_nav=$('#mid_nav'), $news_section=$('#section-1'); var fixed_height = $top_slides.height()+$mid_nav.height(); news_pos = fixed_height-20 ; about_pos = fixed_height+$news_section.height(); services_pos = fixed_height+$news_section.height()*2; clients_pos = fixed_height+$news_section.height()*3; } $(document).ready(function(){ var section_news = $('#section-1'), section_about = $('#section-2'), section_services = $('#section-3'), section_clients = $('#section-4'); setheight(); function setheight(){ var section_height=$(window).height()+200; $section_news.height(section_height); $section_about.height(section_height); $section_services.height(section_height); $section_clients.height(section_height); define_pos(); } }); The second JS File: $(document).ready(function(){ var nav = { '$btn1':$('#btn1'), '$btn2':$('#btn2'), '$btn3':$('#btn3'), '$btn4':$('#btn4'), '$btn5':$('#btn5'), myclick : function(){ myclicked(nav.$btn1,0); myclicked(nav.$btn2,news_pos); myclicked(nav.$btn3,about_pos); myclicked(nav.$btn4,services_pos); myclicked(nav.$btn5,clients_pos); function myclicked(j,k){ j.click(function(e) { e.preventDefault(); $('html,body').animate({scrollTop: k}, 1000); }); } //Is it right to do return{'myclick':myclick}, how to call? seems not logical } } nav.myclick(); // Here will not work because it say news_pos is undefined //if I use setTimeout(nav.myclick,1000), it will works but I want to run it right the when position is caculated. }); How do I pass the nav.myclick() function to the frist js file and put it in setheight() and under define_pos()? By the way writing codes right in stackoverflow is strange,press tab not really give you any spacing.

    Read the article

  • .NET XPath Returns No Results

    - by Stacy Vicknair
    When using XPath in .NET one of the gotchas to be aware of is that all namespaces must be named, otherwise you’ll end up with no results. Default namespaces that are specified with xmlns alone still need to be recognized in the XPath query! Say I had a bit of XML like what is returned from the QueryService web service in Sharepoint: 1: <?xml version="1.0" encoding="UTF-8"?> 2: <ResponsePacket xmlns="urn:Microsoft.Search.Response"> 3: <Response> 4: <Range> 5: ... 6: <Results> 7: <Document xmlns="urn:Microsoft.Search.Response.Document" relevance="849"> 8: ...   When consuming and navigating this response with XPath it is necessary to name all namespaces. Then those named namespaces must be used in reference to the individual element being requested (i.e. doc:Document). In VB: 1: Dim xdoc = new XPathDocument(reader) 2: Dim nav = xdoc.CreateNavigator() 3: Dim nsMgr = new XmlNamespaceManager(nav.NameTable) 4: nsMgr.AddNamespace("resp", "urn:Microsoft.Search.Response") 5: nsMgr.AddNamespace("doc", "urn:Microsoft.Search.Response.Document") 6:  7: Dim results = nav.Select("//doc:Document", nsMgr)   In C#: 1: var xdoc = new XPathDocument(reader); 2: var nav = xdoc.CreateNavigator(); 3: var nsMgr = new XmlNamespaceManager(nav.NameTable); 4:  5: nsMgr.AddNamespace("resp", "urn:Microsoft.Search.Response"); 6: nsMgr.AddNamespace("doc", "urn:Microsoft.Search.Response.Document"); 7:  8: var results = nav.Select("//doc:Document", nsMgr);

    Read the article

  • RUN FUNCTION AFTER SOMETIME IN JQUERY & AUTOMATIC SLICING OF IMAGES

    - by user2697032
    I am not being able to start the automatic slicing of images, it is happening only after a click, how should i modify my code so that i get to change the slicing of the images automatically. <!DOCTYPE html> <html lang="en"> <head> <title>Slicebox - 3D Image Slider</title> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Slicebox - 3D Image Slider with Fallback" /> <meta name="keywords" content="jquery, css3, 3d, webkit, fallback, slider, css3, 3d transforms, slices, rotate, box, automatic" /> <meta name="author" content="Pedro Botelho for Codrops" /> <link rel="shortcut icon" href="../favicon.ico"> <link rel="stylesheet" type="text/css" href="css/demo.css" /> <link rel="stylesheet" type="text/css" href="css/slicebox.css" /> <link rel="stylesheet" type="text/css" href="css/custom.css" /> <script type="text/javascript" src="js/modernizr.custom.46884.js"></script> </head> <body onload="funct()"> <div class="container"> <div class="codrops-top clearfix"> <a href="http://tympanus.net/Development/AutomaticImageMontage/"><span>&laquo; Previous Demo: </span>Automatic Image Montage</a> <span class="right"> <a target="_blank" href="http://www.flickr.com/photos/strupler/">Images by <strong>ND Strupler</strong></a> <a href="http://tympanus.net/codrops/?p=5657"><strong>Back to the Codrops Article</strong></a> </span> </div> <h1>Slicebox <span>A fresh 3D image slider with graceful fallback</span></h1> <div class="more"> <ul id="sb-examples"> <li>More examples:</li> <li class="selected"><a href="index.html">Example 1</a></li> <li><a href="index2.html">Example 2</a></li> <li><a href="index3.html">Example 3</a></li> <li><a href="index4.html">Example 4</a></li> </ul> </div> <div class="wrapper" id="checkthis"> <ul id="sb-slider" class="sb-slider"> <li> <a href="http://www.flickr.com/photos/strupler/2969141180" target="_blank"><img src="images/1.jpg" alt="image1"/></a> <div class="sb-description"> <h3>Creative Lifesaver</h3> </div> </li> <li> <a href="http://www.flickr.com/photos/strupler/2968268187" target="_blank"><img src="images/2.jpg" alt="image2"/></a> <div class="sb-description"> <h3>Honest Entertainer</h3> </div> </li> <li> <a href="http://www.flickr.com/photos/strupler/2968114825" target="_blank"><img src="images/3.jpg" alt="image1"/></a> <div class="sb-description"> <h3>Brave Astronaut</h3> </div> </li> <li> <a href="http://www.flickr.com/photos/strupler/2968122059" target="_blank"><img src="images/4.jpg" alt="image1"/></a> <div class="sb-description"> <h3>Affectionate Decision Maker</h3> </div> </li> <li> <a href="http://www.flickr.com/photos/strupler/2969119944" target="_blank"><img src="images/5.jpg" alt="image1"/></a> <div class="sb-description"> <h3>Faithful Investor</h3> </div> </li> <li> <a href="http://www.flickr.com/photos/strupler/2968126177" target="_blank"><img src="images/6.jpg" alt="image1"/></a> <div class="sb-description"> <h3>Groundbreaking Artist</h3> </div> </li> <li> <a href="http://www.flickr.com/photos/strupler/2968945158" target="_blank"><img src="images/7.jpg" alt="image1"/></a> <div class="sb-description"> <h3>Selfless Philantropist</h3> </div> </li> </ul> <div id="shadow" class="shadow"></div> <div id="nav-arrows" class="nav-arrows"> <a href="#x">Next</a> <a href="#y">Previous</a> </div> <div id="nav-dots" class="nav-dots"> <span class="nav-dot-current"></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> </div> </div><!-- /wrapper --> <p class="info"><strong>Example 1:</strong> Default settings</p> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.slicebox.js"></script> <script type="text/javascript"> $(function() { var Page = (function() { var $navArrows = $( '#nav-arrows' ).hide(), $navDots = $( '#nav-dots' ).hide(), $nav = $navDots.children( 'span' ), $shadow = $( '#shadow' ).hide(), slicebox = $( '#sb-slider' ).slicebox( { onReady : function() { $navArrows.show(); $navDots.show(); $shadow.show(); }, onBeforeChange : function( pos ) { $nav.removeClass( 'nav-dot-current' ); $nav.eq( pos ).addClass( 'nav-dot-current' ); } } ), init = function() { initEvents(); }, initEvents = function() { // add navigation events $navArrows.children( ':first' ).on( 'click', function() { setInterval("callme()", 1000); return false; } ); //$(function(){ //callme(); //}); function callme(){ //$('#checkit').append("callme loaded<br />"); slicebox.next(); setInterval("callme()", 1000); } $navArrows.children( ':last' ).on( 'click', function() { slicebox.previous(); return false; } ); $nav.each( function( i ) { $( this ).on( 'click', function( event ) { var $dot = $( this ); if( !slicebox.isActive() ) { $nav.removeClass( 'nav-dot-current' ); $dot.addClass( 'nav-dot-current' ); } slicebox.jump( i + 1 ); return false; } ); } ); }; return { init : init }; })(); Page.init(); }); </script> <script> // make sure the "myContainer" id in the script is the same id of the div $(document).ready(function() { slicebox.next(); $('#nav-arrows').sbslider(); // this is the piece of code that will do the magic thing }); </script> </body> </html> I am not being able to start the automatic slicing of images, it is happening only after a click, how should i modify my code so that i get to change the slicing of the images automatically.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >