Search Results

Search found 2953 results on 119 pages for 'charlene li'.

Page 51/119 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Simple libxml2 HTML parsing example, using Objective-c, Xcode, and HTMLparser.h

    - by Stu
    Please can somebody show me a simple example of parsing some HTML using libxml. #import <libxml2/libxml/HTMLparser.h> NSString *html = @"<ul><li><input type=\"image\" name=\"input1\" value=\"string1value\" /></li><li><input type=\"image\" name=\"input2\" value=\"string2value\" /></li></ul><span class=\"spantext\"><b>Hello World 1</b></span><span class=\"spantext\"><b>Hello World 2</b></span>"; 1) Say I want to parse the value of the input whose name = input2. Should output "string2value". 2) Say I want to parse the inner contents of each span tag whose class = spantext. Should output: "Hello World 1" and "Hello World 2".

    Read the article

  • jQuery hiding a div on click outside

    - by Lee
    Hi All I would like to build a simple menu for each list element clicked on but hide this div once you click outside it. Here is some simple code which hopefully will make sense. $('.drillFolder').click(function(){ var id = $(this).attr('data-folder'); $(".drillDownFolder ul li > a").attr('data-id', id); $(".drillDownFolder").show(); }); $("body").click(function(e){ if(e.target.className !== "drillDownFolder") { $(".drillDownFolder").hide(); } }); //The hidden div <div class="drillDownFolder" style="display:none"> <ul> <li><a href="#" data-id="">Show Image</a></li> <li><a href="#" data-id="">Edit Image</a></li> </ul> </div> I know whats wrong as the menu is show via the .drillFolder links the body click is then hiding it straight away. How can I avoid this. Thank you if you can advise

    Read the article

  • Is there a 'RadLabel' from Telerik?

    - by Young Ninja
    I use the "Label" attribute in Telerik quite frequently. I like it because it helps me consistently structure tables. An example: <ul class="box"> <li><telerik:RadTextBox runat="server" Label="Name:" LabelCssClass="label" Enabled="false" Width="100%" /></li> <li><telerik:RadTextBox runat="server" ID="MachineSize" Label="Password:" LabelCssClass="label" Width="100%" /></li> </ul> I've run into a problem. I would like to continue with the above layout/structure, but in some cases I have tables that simply dump output (ie no user input). To be consistent, I need a RadLabel, which takes an input of "Label" and "Text", and then aligns them appropriately in the overall table format. Is there such a thing?

    Read the article

  • jquery strange flickering on mouseover/out

    - by Jonah
    The HTML: <div id="timerList"> ... <li rel="project" class="open"> <a class="" style="" href=""><ins>&nbsp;</ins>Project C</a> </li> ... </div> The javascript/jquery: $('#timerList li[rel="project"]').mouseover(function(){ $('a:first',this).after('<span class="addNew"><a href="#">Add Timer</a></span>'); }).mouseout(function(){ $('.addNew',this).remove(); }); When I hover my mouse over an li element, a span.addNew element is created within THE PROBLEM: When I put my mouse ofer the span.addNew, it flickers on and off. Perhaps the mouseout event is firing, but I don't understand why it would or how to prevent it. Thanks!

    Read the article

  • How do I add a toolbar to a region with ExtJS

    - by gargantaun
    I have a border layout in ExtJS, The north region contains some HTML, but also needs to contain a toolbar like this... So i've managed to get the border layout set up, added the html to the North Region of the layout, but I can't find any workable examples of how to implement a tool bar. I have found lot's of examples of toolbars on their own, but I've not got the luxury or learning ExtJs thoroughly so it's all greek to me. I suspect there's a way to define a tool bar outside of the cumbersome JSON style flow of creating a layout and somehow attaching it to the region, and I'm hoping it's relativley simple to do. If someone can explain how I'd do this, it would really help. Here's the code so far... //make sure YOUR path is correct to this image!! Ext.BLANK_IMAGE_URL = '../../ext-2.0.2/resources/images/default/s.gif'; //this runs on DOM load - you can access all the good stuff now. Ext.onReady(function(){ var viewport = new Ext.Viewport({ layout: "border", border: false, renderTo: Ext.getBody(), items: [ // ------------------------------------------------------------------ { region: "north", id : "toolbar-area", xtype: 'panel', html: [ "<div id=\"html-header\">", "<div id=\"council-logo\"></div>", "<ul id=\"ancillary-menu\">", "<li><a href=\"#\">Logout</a></li>", "<li><a href=\"#\">Gazeteer Home</a></li>", "<li>Hello Rachel</li>", "</ul>", "<img id=\"inteligent-logo\" src=\"applied-images/logos/inteligent.gif\">", "</div>" ], /* ++++++++++++++++++++++++++++++++++++++++++++ */ /* The toolbar needs to go around here.... */ /* ++++++++++++++++++++++++++++++++++++++++++++ */ height: 100 }, // ------------------------------------------------------------------ // WEST // ------------------------------------------------------------------ { region: 'west', xtype: 'panel', split: true, resizeable: false, maxWidth : 350, minWidth : 349, collapsible: true, title: 'Gazetteer Explorer', width: 350, minSize: 150, // -------------------------------------------------------------- title: 'Nested Layout', layout: 'border', border: false, id: "west", items: [ { // *********************************************** // Search Form // *********************************************** region : "north", height: 300, split : true, id : "left-form-panel", items : [{ xtype : "form", id : "search-form", items : [ // Authority combo box // =============================== { xtype : "combo", fieldLabel : "Authority", name : "authority", hiddenName : "authority", id : "authority-combo" }, // =============================== // Search Fieldset // =============================== { xtype : "fieldset", autoHeight : true, title : "Search by...", id : "search-fieldset", items : [ // Ref Number text Box // %%%%%%%%%%%%%%%% { xtype : "textfield", name : "ref-number", fieldLabel : "Ref. Number", id : "ref-number-textfield" }, // %%%%%%%%%%%%%%%% // Streetname Combo // %%%%%%%%%%%%%%% { xtype : "combo", name : "street-name", hiddenName : "street-name", fieldLabel : "Street Name", id : "street-name-combo" }, // %%%%%%%%%%%%%%%% // Postcode Combo // %%%%%%%%%%%%%%%% { xtype : "combo", name : "postcode", hiddenName : "postcode", fieldLabel : "Postcode", id : "postcode-combo" }, // %%%%%%%%%%%%%%%% // Postcode Combo // %%%%%%%%%%%%%%%% { xtype : "combo", name : "town", hiddenName : "town", fieldLabel : "Town", id : "towm-combo" }, // %%%%%%%%%%%%%%%% // Postcode Combo // %%%%%%%%%%%%%%%% { xtype : "combo", name : "locality", hiddenName : "locality", fieldLabel : "Locality", id : "locality-combo" }, // %%%%%%%%%%%%%%% // Search Button // %%%%%%%%%%%%%%%% { xtype : "button", text : "Search", id : "search-button" }, // Reset Button // %%%%%%%%%%%%%%% { xtype : "button", text : "Reset", id : "reset-button" } ] }, // ======================= ] }] // ********************************************* }, { region: 'center', html: 'Tree view goes here' } ] }, // ------------------------------------------------------------------ { region: 'center', xtype: 'panel', // -------------------------------------------------------------- layout: 'border', border: false, items: [ { region: 'center', height: 200, split: true, html: 'Map goes here' }, { region: 'south', title: "Selection", split: true, height: 200, collapsible: true, html: 'Nested Center' } ] }, // ------------------------------------------------------------------ { region: 'east', }, // ------------------------------------------------------------------ { region: 'south', }] }); }); Sorry there's so much code, but ExtJS makes me scared to touch anything that's working.

    Read the article

  • jQuery Sortable - Limit number of items in list.

    - by Adam
    I have a schedule table I'm using jQuiry Sortable for editing. Each day is a UL, and each event is an LI. My jQuery is: $("#colSun, #colMon, #colTue, #colWed, #colThu").sortable({ connectWith: '.timePieces', items: 'li:not(.lith)' }).disableSelection(); To make all LI's sortable except those with class "lith" (day names). User can drag an event from day to day, or add new events by clicking a button, which appends a new dragable event (LI) to the fist UL (Sunday). I want to make each day accept only up to 10 events. How do I do this? Thanks in advance!

    Read the article

  • Jquery-UI tabs : Double loading of the default tab

    - by Stephane
    I use jqueryui-tabs to display a tabbed UI. here is how my markup looks in a MasterPage: <div id="channel-tabs" class="ui-tabs"> <ul class="ui-tabs-nav"> <li><%=Html.ActionLink("Blogs", "Index", "Blog", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, new{ title="Blog Results" }) %></li> <li><%=Html.ActionLink("Forums", "Index", "Forums", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> <li><%=Html.ActionLink("Twitter", "Index", "Twitter", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, null) %></li> </ul> <div id="Blog_Results"> <asp:ContentPlaceHolder ID="ResultPlaceHolder" runat="server"> </asp:ContentPlaceHolder> </div> If the content is loaded via ajax, I return a partial view with the content of the tab. If the content is loaded directly, I load a page that include the content in the ContentPlaceHolder. somewhat like this : <asp:Content ID="Content2" ContentPlaceHolderID="BlogPlaceHolder" runat="server"> <%=Html.Partial("Partial",Model) %> </asp:Content> //same goes for the other tabs. With this in place, if I access the url "/Forums" It loads the forum content in the Blog tab first, trigger the ajax load of the Blog tab and replace the content with the blog content. I tried putting a different placeholder for each tab, but that didn't fix everything either, since when loading "/Forums" it will sure load the forum tab, but the Blog tab will show up first. Furthermore, when using separate placeholders, If I load the "/Blogs" url, It will first load the content statically in the Blog contentplaceholder and then trigger an ajax call to load it a second time and replace it. If I just link the tab to the hashtag, then when loading the forum tabs, I won't get the blog content... How would you achieve the expected behaviour? I feel like I might have a deeper probelm in the organization of my views. Is putting the tabs in the masterpage the way to go? Maybe I should just hijax the links manually and not rely on jquery-ui tabs to do the work for me. I cannot load all tabs by default and display them using the hash tags, I need an ajax loading because it is a search process that can be long. So to sum up : /Forum should load the forum tab, and let the other tabs be loaded with an ajax call when clicking on it. /Twitter should load the twitter tab and let the other tabs.... the same goes for /Blogs and any tabs I would add later. Any idea to have this working properly?

    Read the article

  • jQuery UI Tabs Not Working

    - by Christopher
    I just downloaded jQuery UI Tabs. In the included index.html file, it works fine, CSS and all, with no customization. I copied the files over to my web server, keeping the directory structure intact, and copied the content code to my already-existing index.html, but it does not work. My Header Code <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <link type="text/css" href="css/start/jquery-ui-1.8.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script> <script type="text/javascript"> $(function(){ // Tabs $('#tabs').tabs(); }); </script> My Body Code <div id="tabs"> <ul> <li><a href="#tabs-1">First</a></li> <li><a href="#tabs-2">Second</a></li> <li><a href="#tabs-3">Third</a></li> </ul> <div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> <div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div> <div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div> </div> My Output * First * Second * Third Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum. Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue. All of the files are referenced correctly, and it is all copied and pasted directly from a fully functional file., but it will not work.

    Read the article

  • Lists inside lists don't validate with w3c?

    - by cosmicbdog
    Hi everybody, I've got some lists inside lists to make some fancy drop-down menus. e.g <ul> <li>something <ul> <li>sub menu</li> </ul> </li> </ul> Problem is, w3c doesn't like it. Is there a way to make this validate or this just one of these hacks that browsers can render, but w3c dislikes?

    Read the article

  • What is wrong with my PHP/MySQL code?

    - by James
    I am building a navigation menu which lists all my categories and subcategories. The problem is it returns only one of these and not all. I have the categories echoed inside the while loop so I'm not sure why it's only showing one result and not all: <?php $query = mysql_query("SELECT * FROM categories_parent"); while ($row = mysql_fetch_assoc($query)) { $id = $row['id']; $name = $row['name']; $slug = $row['slug']; $childStatus = $row['child_status']; // if has child categories if ($childStatus == "1") { echo "<li class='dir'><a href='category.php?slug=$slug'>$name</a>"; echo "<ul id='dropdown'>"; $query = mysql_query("SELECT * FROM categories_child WHERE parent=$id"); while ($row = mysql_fetch_assoc($query)) { $id = $row['id']; $name = $row['name']; $slug = $row['slug']; echo "<li><a href='category.php?slug=$slug'>$name</a></li>"; } echo "</ul>"; echo "</li>"; } // if singular parent else { echo "<li><a href='category.php?slug=$slug'>$name</a></li>"; } } ?> My database tables: -- -- Table structure for table `categories_child` -- CREATE TABLE IF NOT EXISTS `categories_child` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(1000) NOT NULL, `slug` varchar(1000) NOT NULL, `parent` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=139 ; -- -- Dumping data for table `categories_child` -- INSERT INTO `categories_child` (`id`, `name`, `slug`, `parent`) VALUES (138, 'Britney Spears', 'category/celiberties/britney-spears/', 137), (136, 'Tigers', 'category/animals/tigers/', 136), (137, 'Horses', 'category/animals/horses/', 136), (135, 'Lions', 'category/animals/lions/', 136); -- -- Table structure for table `categories_parent` -- CREATE TABLE IF NOT EXISTS `categories_parent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(1000) NOT NULL, `slug` varchar(1000) NOT NULL, `child_status` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=139 ; -- -- Dumping data for table `categories_parent` -- INSERT INTO `categories_parent` (`id`, `name`, `slug`, `child_status`) VALUES (137, 'Celiberties', 'category/celiberties/', 1), (138, 'TV Shows', 'category/tv-shows/', 0), (136, 'Animals', 'category/animals/', 1);

    Read the article

  • Ruby on Rails simple_navigation Gem

    - by Paul
    I'm using the simple_navigation gem with RoR 2.3.5 It all seems to work correctly, I followed the info in the RDoc (seen here http://rdoc.info/projects/mexpolk/simple_navigation) However, when I actually render out the simple_navigation menu on my main application.html.erb file it escapes all of the html in it (multiple escapes actually). I end up with junk like this which in a browser ends up with all kinds of disjointed text and ["\ things everywhere. <ul class="simple_navigation" depth="0" id="simple_navigation_default"> ["<li class=\"menu\" drop_down=\"true\" id=\"simple_navigation_default_menus_home\"><a href=\"/home\">Wellcome</a><ul depth=\"1\" id=\"simple_navigation_default_menus_home_menus\"> [\"<li class=\\\"menu\\\" drop_down=\\\"false\\\" id=\\\"simple_navigation_default_menus_home_menus_settings\\\"><a href=\\\"/home/settings\\\">Appliction Settings</a></li>\"] </ul> </li>"] What am I doing wrong? Is there a way to tell Ruby on rails to NOT escape html?

    Read the article

  • Actionscript 3 and nested lists

    - by Hanpan
    Hi, I have the following code in my XML (EDIT:) which I am trying to show in a RichText using htmlText. <ul> <li>List Item 1 <ul> <li>List Item 2</li> </ul> </li> </ul> Unfortunately, Flash doesn't seem to support nested lists, and I am getting output which looks like this: List item 1 List item 2 Where I want the second ul to be indented further. Any ideas would be much appreciated! Cheers

    Read the article

  • jQuery.width() & DOM refresh

    - by o_O Tync
    My script dynamically creates a <ul> width left-floating <li>s inside: it's a paginator. Afterwards, the script measures width of all <li>s and summs them up. The problem is that after the nodes are injected into the document — the browser refreshed DOM and applies CSS styles which takes a while. It has a negative effect on my script: when these operations are not complete before I measure the width — my script gets a wrong value. If I perform the measure in a second — everything is ok. The thing I'm looking for is a way to detect the moment when the <ul> is fully drawn, styles applied and the width has stabilizes. Or at least a way to detect every dimensions changes. If there's a way to detect width stabilization — I would do the measuring right after it to get the correct values. P.S. Why I need this. My paginator's left-floating <li> items tend to move to the next line when the <ul> tries to become wider than the page itself. Even though most of <li>s are invisible because of parent <div>'s width restriction: div { width: 500px; overflow: hidden; } div ul { width: 100%; white-space: nowrap; } div ul li { display: block; float: left; } they still go down unless I specify the actual summed width of the <ul> with the script.

    Read the article

  • MIPS return address in main

    - by Alexander
    I am confused why in the code below I need to decrement the stack pointer and store the return address again. If I don't do that... then PCSpim keeps on looping.. Why is that? ######################################################################################################################## ### main ######################################################################################################################## .text .globl main main: addi $sp, $sp, -4 # Make space on stack sw $ra, 0($sp) # Save return address # Start test 1 ############################################################ la $a0, asize1 # 1st parameter: address of asize1[0] la $a1, frame1 # 2nd parameter: address of frame1[0] la $a2, window1 # 3rd parameter: address of window1[0] jal vbsme # call function # Printing $v0 add $a0, $v0, $zero # Load $v0 for printing li $v0, 1 # Load the system call numbers syscall # Print newline. la $a0, newline # Load value for printing li $v0, 4 # Load the system call numbers syscall # Printing $v1 add $a0, $v1, $zero # Load $v1 for printing li $v0, 1 # Load the system call numbers syscall # Print newline. la $a0, newline # Load value for printing li $v0, 4 # Load the system call numbers syscall # Print newline. la $a0, newline # Load value for printing li $v0, 4 # Load the system call numbers syscall ############################################################ # End of test 1 lw $ra, 0($sp) # Restore return address addi $sp, $sp, 4 # Restore stack pointer jr $ra # Return ######################################################################################################################## ### vbsme ######################################################################################################################## #.text .globl vbsme vbsme: addi $sp, $sp, -4 # create space on the stack pointer sw $ra, 0($sp) # save return address exit: add $v1, $t5, $zero # (v1) x coordinate of the block in the frame with the minimum SAD add $v0, $t4, $zero # (v0) y coordinate of the block in the frame with the minimum SAD lw $ra, 0($sp) # restore return address addi $sp, $sp, 4 # restore stack pointer jr $ra # return If I delete: addi $sp, $sp, -4 # create space on the stack pointer sw $ra, 0($sp) # save return address and lw $ra, 0($sp) # restore return address addi $sp, $sp, 4 # restore stack pointer on vbsme: PCSpim keeps on running... Why??? I shouldn't have to increment/decrement the stack pointer on vbsme and then do the jr again right? The jal in main is supposed to handle that

    Read the article

  • CSS height problem. IE8 seems correct Firefox seems wrong. Any fix?

    - by user169867
    Below is a complete html page that shows the problem. The "myDiv" should be 22px in height (including the border). Item 1 should have a 1px space between its border and the divs border. In IE8 it is. In FF 3.6.2 though it is 24px and I can't understand why. Ultimately my goal is to get the same CSS to create the same result in both browsers. It's driving me crazy! Any help would be appreciated :) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <style type="text/css"> div.aclb {background:#EEF3FA; color:#666; cursor:text; padding:1px; overflow-y:auto; border:#BBC8D9 1px solid; } div.aclb:hover {border:#3399FF 1px solid;} div.aclb.focus {background:#FFF; border:#3399FF 1px solid;} div.aclb ul {padding:0; margin:0; list-style:none; display:table; vertical-align:middle; } div.aclb li {float:left; cursor:default; font-family:Arial; padding:0; margin:0;} div.aclb li.block {padding:0px 2px; height:16px; white-space:nowrap; border:solid 1px #BBD8FB; background:#f3f7fd; font-size:11px; line-height:16px;} div.aclb li.block:hover {border:solid 1px #5F8BD3; background:#E4ECF8; color:#000;} div.aclb li.input {} div.aclb input {margin:0; padding:0; height:18px; background:transparent; border:none; color:#666; overflow:hidden; resize:none; font-family:Arial; font-size:13px; outline:none;} div.aclb input:focus {margin:0; padding:0; height:18px; background:transparent; border:none; color:#22F; overflow:hidden; resize:none; font-family:Arial; font-size:13px; outline:none;} div.aclb a.d {cursor:pointer; display:block; color:#6B6B6B; width:13px; height:12px;float:right; margin:1px 0 1px 4px; border:solid 1px transparent; font-family:Verdana; font-size:11px; text-align:center; line-height:10px;} div.aclb a.d:hover { border:solid 1px #7DA2CE; background:#F7FAFD; color:#AD0B0B;} div.aclb a.d:active {border:solid 1px #497CBB; background:#BAD8E8; color:#A90909;} </style> </head> <body> <div id="myDiv" style="width:250px" class="aclb"> <ul> <li class="block"> <a class="d">x</a><span>Item 1</span> </li> <li class="input"> <input type="text" style="width:30px" maxlength="30"/> </li> </ul> </div> </body> </html>

    Read the article

  • How to dynamically set control IDs inside a repeater template?

    - by Bryan
    Here is a perplexing issue I have not seen a good answer to on StackOverflow, although there a couple stabs at it... I have a situation where I'd like to do this: <asp:Repeater ID="MyRepeater" runat="server" OnItemDataBound="MyRepeater_ItemDataBound"> <ItemTemplate> <li id="id?"> All the other stuff </li> </ItemTemplate> </asp:Repeater> The question... is how do I get the ID of my <li> elements to be id1, id2, id3, etc., based on the ItemIndex they are bound to? So far the most... er..."elegant" solution I've come up with is to replace the <li> with an asp:Literal and dump the <li...>' text. But that just feels... so wrong. And no, I'm not using ASP.NET 4.0, which I've read will provide this functionality.

    Read the article

  • Jquery get attribute of few ul to create another attribute

    - by Josemalive
    Hello, I have the following HTML: <ul actualpage=0> <li/> <li/> .... </ul> <ul actualpage=0> <li/> <li/> .... </ul> Im trying to get the value of actualpage of each ul and create a new attribute. Its easy but not in one jquery sentence... Its possible? Until now i have the following line (between ## simbols the missing part that i need. /* select all uls with attribute actualpage and create a new attribute on each with the current actualpage value */ $('ul[actualpage]').attr('newactualpage',##Current value of actualpage attr of UL##);

    Read the article

  • Wordpress dynamic navigation function for highlighting single post tabs

    - by user269959
    I am trying to write a function that i can reuse in my wordpress themes that will allow me to build robust dynamic navigation menus. Here is what i have so far: function tab_maker($page_name, $href, $tabname) { //opens <li> tag to allow active class to be inserted if tab is on proper page echo "<li"; //checks that we are on current page and highlights tab as active if so if(is_page($page_name)){ echo " class='current_page_item'>"; } //closes <li> tab if not active else { echo ">"; } //inserts the link as $href and the name of the tab to appear as $tabname then closes <li> echo "<a href=$href>$tabname</a>"; echo "</li>"; } This code works as expected except i cant enable it to highlight for a single blog post as the page names are dynamic. I know about the wordpress function is_single() which ive used to implement this feature in previous nav menus but i cant find a way to integrate it into this function. appreciate any help!

    Read the article

  • Accessible semantic jQuery tabs plugin

    - by user249950
    Hello, Just a quick question to see if anyone knows of any jquery tabs plugins that run based on a similar structure to: <div class="tabs"> <div> <h4>Tab one</h4> <p>Lorem Ipsum</p> </div> <div> <h4>Tab two</h4> <p>Lorem Ipsum</p> </div> </div> Where the plugin grabs the title of the tabs from the h4s? I can only seem to find plugins that use the structure: <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>Tab 1 content</p> </div> <div id="tabs-2"> <p>Tab 2 content</p> </div> <div id="tabs-3"> <p>Tab 3 content</p> </div> </div> I assume the only other way to use these plugins would be to grab the titles, remove them, add them into a list at the top of the html and then run the plugin based on that? I just ask as I am quite new to jQuery so I'm not sure how I would go about it and just wondered if there was a plugin already in existence that anyone knew of. If not, not to worry, I'll have to get busy with the docs and give it a go! Cheers

    Read the article

  • What’s wrong with this code

    - by Arlen Beiler
    I get this error for the code below, what does it mean? [Fri Apr 23 10:57:42 2010] [error] [client 10.0.0.1] PHP Fatal error: Cannot re-assign $this in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\abp\fol\test.php on line 27, referer: http://abp.bhc.com/fol/ <?php $voiceboxes = array( '141133' => array( 'title' => 'Title', '1' => array( 'Title' => 'Title2', 'Link' => 'http://...', ), '12' => array( 'Title' => 'Title3', 'Link' => 'http://...', ) ), '1070453' => array( 'title' => 'Title4', '1' => array( 'Title' => 'Title5', 'Link' => 'http://...', ) ) ); $last = 0; //$this = 0; echo "<ol>\n"; foreach ($voiceboxes as $key => $value) { $last = 0; $this = null; //Error is thrown here, Line 27 //$voiceboxes[$key]['title'] echo "<ol>\n"; foreach ($value as $key2 => $value2) { if ($key2 == 'title') { echo "<li>$value2</li>\n"; } else { $this = (int) $key2; if ($this == $last + 1) { echo '<li>'; } else { '<li value="' . $key2 . '">';} $last = $key2; echo $voiceboxes[$key][$key2]['Title'] . "<br/>" . $voiceboxes[$key][$key2]['Link'] . '</li>' . "\n"; } } echo "</ol>\n"; }

    Read the article

  • jQuery: Insert html from "title" tag into a "span" of a H2 tag

    - by lorenzium
    Hey guys, Say I had the following HTML: <h2>Heading <span></span></h2> <ul> <li><a href="#" title="I am wanting to be in H2!">Something</a></li> <li><a href="#" title="I too am wanting to be in H2!">Something else</a></li> </ul> I want to be able to take the title tag from the and place it inside the span of the h2. How can I do so? Cheers.

    Read the article

  • jquery slide toggle divs without creating multiple classes, functions, etc... ui accordion

    - by SPE
    Greetings, based on the jquery ui accordion I'm using, I have added a slide toggle to my accordion list items. so what happens is I click on an li and a div slides down underneath to reveal more content. The issue I'm having is that I find myself having to create multiple id's to reference the slidetoggle. example of the div id css: #panel, #panel2, #panel3, #panel4, etc.... the Is there a way I can use the slide toggle without having to adding another number so it will slide? I have 50 list items I'm using: Here's a sample of the js (as you can see where I'm going with this): $(".btn-slide").click(function(){ $("#panel").slideToggle("slow"); $(this).toggleClass("active"); return false; }); $(".btn-slide2").click(function(){ $("#panel2").slideToggle("slow"); $(this).toggleClass("active"); return false; }); sample html: <li><div class="slide"><a href="#" class="btn-slide">One</a></div><div id="panel"></div></li> <li><div class="slide"><a href="#" class="btn-slide2">Two</a></div><div id="panel2"></div></li>

    Read the article

  • Displaying Django Messages Framework Messages

    - by Arif
    I have been using the Django Messaging Framework to display messages to a user in the template. I am outputting them to the template like this: <ul> {% for message in messages %} <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> {% endfor %} </ul> This outputs all the messages, errors, warning, success etc. I was just wondering if anyone had any ideas how to display only the error messages something like: <ul> {% for message in messages.errors %} <li>{{ message }}</li> {% endfor %} </ul> Any ideas? Thanks in advance.

    Read the article

  • jQuery galleria plugin with dynamically loaded images

    - by panas
    I'm using the Galleria plugin with jQuery to create my image gallery. I'm trying to get load images dynamically from the user's selection into the DOM and have the gallery auto-update to display those new images but it's not working. Firebug shows the images are successfully loading into the DOM but Galleria displays no thumbnails. I need a way to reload Galleria to display the new images. /* ---- Gallery Code ---- */ if ($(this).find('div').attr('title') == 'photogallery' && $('.galleria_container').length == 0) { $('.gallery').galleria( { history : false, clickNext : true, onImage : function(image,caption,thumb) { if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { image.css('display','none').fadeIn(1000); } var _li = thumb.parents('li'); caption.css('display','none').fadeIn(1000); _li.siblings().children('img.selected').fadeTo(500,0.3); thumb.fadeTo('fast',1).addClass('selected'); image.attr('title','Next image >>'); }, onThumb : function(thumb) { var _li = thumb.parents('li'); var _fadeTo = _li.is('.active') ? '1' : '0.3'; thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500); thumb.hover ( function() { thumb.fadeTo('fast',1); }, function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active ) } }); } /* ---- Gallery Selector ---- */ $(document).ready(function() { var galleryImages = new Object(); <?php echo $myGal; ?> function setImages(type) { var image = ''; for (var i = 0; i < galleryImages[type].length; i++) { image += '<li><img src="' + galleryImages[type][i] + '"></li>'; } $('ul.gallery').html(image); } $('ul.menu-horiz li ul li').click(function() { setImages($(this).attr('rel')); }); }); The PHP code you see just creates an array of images. So to summarise my question: How can I reload Galleria once the new images have been loaded into the DOM?

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >