Search Results

Search found 2593 results on 104 pages for 'span'.

Page 16/104 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • css problem lining up some icons...

    - by Ronedog
    I'm having a problem lining up some icons and am new enough to css that I'm not exactly sure how to explain this. So I've attached a picture of what the out put is rendering like. I've also included what the css and html code is. Hopefully someone can help point me in the right direction to help fix this. I want the "edit", "archive", "delete" icons to all line up in the right side exactly the same as the first row in the picture. Here is the html: <ul id="nav"> <li>California <div class="portf_edit"> <span> <img src="../images/edit.png"> </span> </div> <div class="portf_archive"> <span> <img src="../images/archive.png"> </span> </div> <div class="portf_delete"> <span> <img src="../images/delete.png"> </span> </div> </li> <li>Hyrum <div class="portf_edit"> <span> <img src="../images/edit.png"> </span> </div> <div class="portf_archive"> <span> <img src="../images/archive.png"> </span> </div> <div class="portf_delete"> <span> <img src="../images/delete.png"> </span> </div> </li> Here is the css: li { list-style-type:none; vertical-align: bottom; list-style-image: none; left:0px; text-align:left; } ul { list-style-type: none; vertical-align: bottom; list-style-image: none; left:0px; } ul#nav{ margin-left:0; padding-left:0px; text-indent:15px; } .portf_edit{ float:right; position: relative; right:50px; display:block; } .portf_archive{ float:right; position: relative; right:-5px; display:block; } .portf_delete{ float:right; position: relative; right: -60px; display:block; } Here's what is being output: Any ideas where to start? Thanks.

    Read the article

  • PHP behaves weird, mixing up HTML markup.

    - by adardesign
    Thanks for looking on this problem. I have a page that is totally valid page, and there is a PHP loop that brings in a <li> for each entry of the table. When i check this page locally it looks 100% OK, but when veiwing the page online the left side bar (which creates this markup is broken randomly mixing <div>'s and <li>'s and i have no clue what the problem is. See page (problem is on the left side) php code <?php do { ?> <li class="clear-block" id="<?php echo $row_Recordset1['penSKU']; ?>"> <a title="Click to view the <?php echo $row_Recordset1['penName']; ?> collection" rel="<?php echo $row_Recordset1['penSKU']; ?>"> <img src="prodImages/small/<?php echo $row_Recordset1['penSKU']; ?>.png" alt="" /> <div class="prodInfoCntnr"> <div class="basicInfo"> <span class="prodName"><?php echo $row_Recordset1['penName']; ?></span> <span class="prodSku"><?php echo $row_Recordset1['penSKU']; ?></span> </div> <div class="secondaryInfo"> <span>As low as .<?php echo $row_Recordset1['price25000']; ?>¢ <!--<em>(R)</em>--></span> <div class="colorPlacholder" rel="<?php echo $row_Recordset1['penColors']; ?>"></div> </div> </div> <div class="additPenInfo"> <div class="imprintInfo"><span>Imprint area: </span><?php echo $row_Recordset1['imprintArea']; ?></div> <div class="colorInfo"><span>Available in: </span><?php echo $row_Recordset1['penColors']; ?></div> <table border="0" cellspacing="0" cellpadding="0"> <tr> <th>Amount</th> <th>500</th> <th>1,000</th> <th>2,500</th> <th>5,000</th> <th>10,000</th> <th>20,000</th> </tr> <tr> <td>Price <span>(R)</span></td> <td><?php echo $row_Recordset1['price500'];?>¢</td> <td><?php echo $row_Recordset1['price1000'];?>¢</td> <td><?php echo $row_Recordset1['price2500'];?>¢</td> <td><?php echo $row_Recordset1['price5000'];?>¢</td> <td>Please Contact</td> <td>Please Contact</td> </tr> </table> </div> </a> </li> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

    Read the article

  • jquery get radiobuttonlist by name dynamically

    - by Cindy
    I have two radiobuttonlist and one checkboxlist on the page. Ideally based on the checkbox selected value, I want to enable/disable corresponding radibuttonlist with jquery function. But some how $("input[name*=" + columnName + "]") always return null. It can not find the radiobuttonlist by its name? $(function() { function checkBoxClicked() { var isChecked = $(this).is(":checked"); var columnName = "rblColumn" + $(this).parent().attr("alt"); if (isChecked) { $("input[name*=" + columnName + "]").removeAttr("disabled"); } else { $("input[name*=" + columnName + "]").attr("disabled", "disabled"); $("input[name*=" + columnName + "] input").each(function() { $(this).attr("checked", "") }); } } //intercept any check box click event inside the #list Div $(":checkbox").click(checkBoxClicked); }); <asp:Panel ID="TestPanel" runat="server"> <asp:CheckBoxList ID = "chkColumn" runat="server" RepeatDirection="Horizontal"> <asp:ListItem id = "Column1" runat="server" Text="Column 1" Value="1" alt="1" class="HeadColumn" /> <asp:ListItem id = "Column2" runat="server" Text="Column 2" Value="2" alt="2" class="HeadColumn"/> </asp:CheckBoxList> <table> <tr> <td> <asp:RadioButtonList ID = "rblColumn1" runat="server" RepeatDirection="Vertical" disabled="disabled"> <asp:ListItem id="liColumn1p" runat="server" /> <asp:ListItem id="liColumn1n" runat="server" /> </asp:RadioButtonList> </td> <td> <asp:RadioButtonList ID = "rblColumn2" runat="server" RepeatDirection="Vertical" disabled="disabled"> <asp:ListItem id="liColumn2p" runat="server" /> <asp:ListItem id="liColumn2n" runat="server" /> </asp:RadioButtonList> </td> </tr> </table> </asp:Panel> source: <div id="TestPanel"> <table id="chkColumn" border="0"> <tr> <td><span id="Column1" alt="1" class="HeadColumn"><input id="chkColumn_0" type="checkbox" name="chkColumn$0" /><label for="chkColumn_0">Column 1</label></span></td><td><span id="Column2" alt="2" class="HeadColumn"><input id="chkColumn_1" type="checkbox" name="chkColumn$1" /><label for="chkColumn_1">Column 2</label></span></td> </tr> </table> <table> <tr> <td> <table id="rblColumn1" class="myRadioButtonList" disabled="disabled" border="0"> <tr> <td><span id="liColumn1p"><input id="rblColumn1_0" type="radio" name="rblColumn1" value="" /></span></td> </tr><tr> <td><span id="liColumn1n"><input id="rblColumn1_1" type="radio" name="rblColumn1" value="" /></span></td> </tr> </table> </td> <td> <table id="rblColumn2" class="myRadioButtonList" disabled="disabled" border="0"> <tr> <td><span id="liColumn2p"><input id="rblColumn2_0" type="radio" name="rblColumn2" value="" /></span></td> </tr><tr> <td><span id="liColumn2n"><input id="rblColumn2_1" type="radio" name="rblColumn2" value="" /></span></td> </tr> </table> </td> </tr> </table> </div>

    Read the article

  • How to cleverly stop "while loop" (php)

    - by user3735697
    I'm having trouble with creating code that echoes a bunch of stuff that is corresponding to the mysql database row. It needs to keep creating the content until all rows are used and then stop. But for some reason the php file causes the browser to keep loading (it never ends). Any help would be appreciated! Thanks! <?php mysql_connect ("localhost", "root", "") or die ("We couldn't connect!"); mysql_select_db ("dr"); mysql_query ("SELECT * FROM songs"); $result = mysql_query ("SELECT * FROM songs"); while ($row=mysql_fetch_array($result)) { $name = $row ['songname']; $genres = $row ['songgenres']; $mediafire = $row ['mediafirelink']; $dropbox = $row ['dropboxlink']; $source = $row ['audiosource']; echo " <div class='playing'> <!-- ======== Song Name ======== --> <li class='songnameli' id='$source'> <span class='info'>$name</span> <audio> <source src='music/singles/$source.mp3'> <source src='music/singles/$source.ogg'> </audio> </li> <!-- ======== Playlist ======== --> <li class='playlistli'> <img src='icons/addtoplaylist.png' title='Add tot the playlist!' /> </li> <!-- ======== Genres ======== --> <li class='genresli'> <img src='icons/genres.png' title='Related genres' /> <span class='addedtext genres'>$genres</span> </li> <!-- ======== Social Media links ======== --> <li> <span> <img src='icons/share.png' alt='Share this with your friends!' title='Share this!'> <!-- /// facebook /// --> <a href='http://www.facebook.com/sharer.php?u=http://www.declassified-recordings.com' class='addedtext nlink' target='blank_' onclick='popup (this.href, 800, 500); return false'>Facebook </a> <span>/</span> <!-- /// Twitter /// --> <a href='http://twitter.com/share? text=Thank%20you%20For%20Sharing!%20It%20means%20the%20world%20to%20us!%40Declassifi3d%20 &url=http://www.declassified-recordings.com' class='twitterlink nlink' target='blank_' onclick='popup (this.href, 800, 500); return false'>Twitter</a> </span> </li> <!-- ======== Download links ======== --> <li> <img src='icons/download.png' title='Download!' /> <span> <!-- /// Mediafire /// --> <a href='$mediafire' class='addedtext nlink' target='_blank'>Mediafire</a> <span class='genres'>/</span> <!-- /// Dropbox /// --> <a href='$mediafire' class='twitterlink nlink' target='_blank'>Dropbox</a> </span> </li> </div>"; } mysql_close (); ?>

    Read the article

  • Why isn't the inline element inheriting height from its children?

    - by jbarz
    I'm trying to make a rather complicated grid of images and information (almost like Pinterest). Specifically, I'm trying to inline position one set of <ul>s right after another. I have it working but one aspect is causing issues so I'm trying to ask about this small piece to avoid the complication of the whole problem. In order to horizontally align the images and their information we are using inline <li>s with other inline-block level elements inside of them. Everything works correctly for the most part except that the <li>s have almost no height. HTML and CSS is in JSFiddle here if you want to mess with it in addition to below: HTML: <div> <ul class="Container"> <li> <span class="Item"> <a href="#"><img src="http://jsfiddle.net/img/logo.png"/></a> <span class="Info"> <a href="#">Title One</a> <span class="Details">One Point One</span> </span> </span> </li> <li> <span class="Item"> <a href="#"><img src="http://jsfiddle.net/img/logo.png"/></a> <span class="Info"> <a href="#">Title Two</a> <span class="Details">Two Point One</span> </span> </span> </li> </ul> CSS: .Container { list-style-type:none; } .Container li { background-color:grey; display:inline; text-align:center; } .Container li .Item { border:solid 2px #ccc; display:inline-block; min-height:50px; vertical-align:top; width:170px; } .Container li .Item .Info { display:inline-block; } .Container li .Item .Info a { display:inline-block; width:160px; } If you check out the result in the jsfiddle link you can see that the grey background only encompasses a small strip of the whole <li>. I know that changing the <li> to display:inline-block solves this problem but that isn't feasible for other reasons. So first of all, I'm just looking to see if anyone understands why the inline <li> element doesn't have any height. I can't find anything in the spec that explains this. I know I can't add height to an inline element but any explanation as to why this is happening that might enable me to fix would be great. Secondly, if you inspect the elements using IE's Developer Mode you will see that although the background color is in the correct location, the actual location of the <li>'s bounding box is at the bottom of the container according to hovering over the element. I could deal with this problem if it was at the top in every browser but it apparently varies. NOTE: I don't really care about older browsers in this case but I don't use HTML5 or JavaScript positioning. Thanks.

    Read the article

  • jQuery Treeview – Expand and Collapse All Without the TreeControl

    - by Ben Griswold
    The jQuery Treeview Plugin provides collapse all, expand all and toggle all support with very little effort on your part. Simply add a treecontrol with three links, and the treeview, to your page…   <div id="treecontrol">     <a title="Collapse the entire tree below" href="#"><img src="../images/minus.gif" /> Collapse All</a>     <a title="Expand the entire tree below" href="#"><img src="../images/plus.gif" /> Expand All</a>     <a title="Toggle the tree below, opening closed branches, closing open branches" href="#">Toggle All</a> </div> <ul id="treeview" class="treeview-black">     <li>Item 1</li>     <li>         <span>Item 2</span>         <ul>             <li>                 <span>Item 2.1</span>                   <ul>                     <li>Item 2.1.1</li>                     <li>Item 2.1.2</li>                 </ul>             </li>             <li>Item 2.2</li>             <li class="closed">                   <span>Item 2.3 (closed at start)</span>                 <ul>                     <li>Item 2.3.1</li>                     <li>Item 2.3.2</li>                 </ul>             </li>         </ul>     </li> </ul> …and then associate the control to the treeview when defining the treeview settings. $("#treeview").treeview({     control: "#treecontrol",     persist: "cookie",     cookieId: "treeview-black" }); It really couldn’t be easier and it works great! But the plugin doesn’t offer a lot of flexibility when it comes to layout.  For example, the plugin assumes your treecontrol will include links.  If you want buttons or images or whatever, you are out of luck.  The plugin also assumes a set number of links and the collapse all handler is associated with the first link inside of the treecontrol, a:eq(0), the expand all handler is associated with the second link and so on.  So you really can’t incorporate the toggle all link by itself unless you manually hide the other options. Which brings me to the point of this post – making the collapse/expand/toggle layout more flexible without modifying the plugin’s source code. We will continue to use the treecontrol actions but we’re not going to use them directly. In fact, our custom collapse, expand and toggle links will trigger the actions for us.  So, hide the treecontrol links and associate the treecontrol click events with the click events of other controls.  Finally, render the treeview with the same setting definitions as usual. $(document).ready(function() {     // The plugin shows the treecontrol after the     // collapse, expand and toggle events are hooked up     // Just hide the links.     $('#treecontrol a').hide();       // On click of your custom links, button, etc     // Trigger the appropriate treecontrol click     $('#expandAll').click(function() {                 $('#treecontrol a:eq(1)').click();         });          $('#collapseAll').click(function() {         $('#treecontrol a:eq(0)').click();             });       // Render the treeview per usual.         $("#treeview").treeview({         control: "#treecontrol",         persist: "cookie",         cookieId: "treeview-black"     }); }); Since I’m not using the treecontrol directly, I move it to the bottom of the page but it doesn’t really matter where the treecontrol goes. <div>     <a id="collapseAll" href="#">Collapse All Outside of TreeControl</a> </div>   <ul id="treeview" class="treeview-black">     <li>Item 1</li>     <li>         <span>Item 2</span>         <ul>             <li>                 <span>Item 2.1</span>                 <ul>                     <li>Item 2.1.1</li>                     <li>Item 2.1.2</li>                 </ul>             </li>             <li>Item 2.2</li>             <li class="closed">                 <span>Item 2.3 (closed at start)</span>                 <ul>                     <li>Item 2.3.1</li>                     <li>Item 2.3.2</li>                 </ul>             </li>         </ul>     </li> </ul>   <div>     <input type="button" id="expandAll" value="Expand All Outside of TreeControl"/> </div>   <div id="treecontrol">     <a href="#"></a><a href="#"></a><a href="#"></a> </div> The above jQuery and Html snippets generate the following ugly output which shows the separated collapse/expand elements. If you want the toggle all option, I bet you can figure out how to put it in place.  I’ve made the source available below if you’re interested. Download jQuery Treeview Expand and Collapse Super Code

    Read the article

  • Metro: Creating a Master/Detail View with a WinJS ListView Control

    - by Stephen.Walther
    The goal of this blog entry is to explain how you can create a simple master/detail view by using the WinJS ListView and Template controls. In particular, I explain how you can use a ListView control to display a list of movies and how you can use a Template control to display the details of the selected movie. Creating a master/detail view requires completing the following four steps: Create the data source – The data source contains the list of movies. Declare the ListView control – The ListView control displays the entire list of movies. It is the master part of the master/detail view. Declare the Details Template control – The Details Template control displays the details for the selected movie. It is the details part of the master/detail view. Handle the selectionchanged event – You handle the selectionchanged event to display the details for a movie when a new movie is selected. Creating the Data Source There is nothing special about our data source. We initialize a WinJS.Binding.List object to represent a list of movies: (function () { "use strict"; var movies = new WinJS.Binding.List([ { title: "Star Wars", director: "Lucas"}, { title: "Shrek", director: "Adamson" }, { title: "Star Trek", director: "Abrams" }, { title: "Spiderman", director: "Raimi" }, { title: "Memento", director: "Nolan" }, { title: "Minority Report", director: "Spielberg" } ]); // Expose the data source WinJS.Namespace.define("ListViewDemos", { movies: movies }); })(); The data source is exposed to the rest of our application with the name ListViewDemos.movies. Declaring the ListView Control The ListView control is declared with the following markup: <div id="movieList" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.movies.dataSource, itemTemplate: select('#masterItemTemplate'), tapBehavior: 'directSelect', selectionMode: 'single', layout: { type: WinJS.UI.ListLayout } }"> </div> The data-win-options attribute is used to set the following properties of the ListView control: itemDataSource – The ListView is bound to the list of movies which we created in the previous section. Notice that the ListView is bound to ListViewDemos.movies.dataSource and not just ListViewDemos.movies. itemTemplate – The item template contains the template used for rendering each item in the ListView. The markup for this template is included below. tabBehavior – This enumeration determines what happens when you tap or click on an item in the ListView. The possible values are directSelect, toggleSelect, invokeOnly, none. Because we want to handle the selectionchanged event, we set tapBehavior to the value directSelect. selectionMode – This enumeration determines whether you can select multiple items or only a single item. The possible values are none, single, multi. In the code above, this property is set to the value single. layout – You can use ListLayout or GridLayout with a ListView. If you want to display a vertical ListView, then you should select ListLayout. You must associate a ListView with an item template if you want to render anything interesting. The ListView above is associated with an item template named #masterItemTemplate. Here’s the markup for the masterItemTemplate: <div id="masterItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="movie"> <span data-win-bind="innerText:title"></span> </div> </div> This template simply renders the title of each movie. Declaring the Details Template Control The details part of the master/detail view is created with the help of a Template control. Here’s the markup used to declare the Details Template control: <div id="detailsTemplate" data-win-control="WinJS.Binding.Template"> <div> <div> Title: <span data-win-bind="innerText:title"></span> </div> <div> Director: <span data-win-bind="innerText:director"></span> </div> </div> </div> The Details Template control displays the movie title and director.   Handling the selectionchanged Event The ListView control can raise two types of events: the iteminvoked and selectionchanged events. The iteminvoked event is raised when you click on a ListView item. The selectionchanged event is raised when one or more ListView items are selected. When you set the tapBehavior property of the ListView control to the value “directSelect” then tapping or clicking a list item raised both the iteminvoked and selectionchanged event. Tapping a list item causes the item to be selected and the item appears with a checkmark. In our code, we handle the selectionchanged event to update the movie details Template when you select a new movie. Here’s the code from the default.js file used to handle the selectionchanged event: var movieList = document.getElementById("movieList"); var detailsTemplate = document.getElementById("detailsTemplate"); var movieDetails = document.getElementById("movieDetails"); // Setup selectionchanged handler movieList.winControl.addEventListener("selectionchanged", function (evt) { if (movieList.winControl.selection.count() > 0) { movieList.winControl.selection.getItems().then(function (items) { // Clear the template container movieDetails.innerHTML = ""; // Render the template detailsTemplate.winControl.render(items[0].data, movieDetails); }); } }); The code above sets up an event handler (listener) for the selectionchanged event. The event handler first verifies that an item has been selected in the ListView (selection.count() > 0). Next, the details for the movie are rendered using the movie details Template (we created this Template in the previous section). The Complete Code For the sake of completeness, I’ve included the complete code for the master/detail view below. I’ve included both the default.html, default.js, and movies.js files. Here is the final code for the default.html file: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ListViewMasterDetail</title> <!-- WinJS references --> <link href="//Microsoft.WinJS.0.6/css/ui-dark.css" rel="stylesheet"> <script src="//Microsoft.WinJS.0.6/js/base.js"></script> <script src="//Microsoft.WinJS.0.6/js/ui.js"></script> <!-- ListViewMasterDetail references --> <link href="/css/default.css" rel="stylesheet"> <script src="/js/default.js"></script> <script type="text/javascript" src="js/movies.js"></script> <style type="text/css"> body { font-size: xx-large; } .movie { padding: 5px; } #masterDetail { display: -ms-box; } #movieList { width: 300px; margin: 20px; } #movieDetails { margin: 20px; } </style> </head> <body> <!-- Templates --> <div id="masterItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="movie"> <span data-win-bind="innerText:title"></span> </div> </div> <div id="detailsTemplate" data-win-control="WinJS.Binding.Template"> <div> <div> Title: <span data-win-bind="innerText:title"></span> </div> <div> Director: <span data-win-bind="innerText:director"></span> </div> </div> </div> <!-- Master/Detail --> <div id="masterDetail"> <!-- Master --> <div id="movieList" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.movies.dataSource, itemTemplate: select('#masterItemTemplate'), tapBehavior: 'directSelect', selectionMode: 'single', layout: { type: WinJS.UI.ListLayout } }"> </div> <!-- Detail --> <div id="movieDetails"></div> </div> </body> </html> Here is the default.js file: (function () { "use strict"; var app = WinJS.Application; app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { WinJS.UI.processAll(); var movieList = document.getElementById("movieList"); var detailsTemplate = document.getElementById("detailsTemplate"); var movieDetails = document.getElementById("movieDetails"); // Setup selectionchanged handler movieList.winControl.addEventListener("selectionchanged", function (evt) { if (movieList.winControl.selection.count() > 0) { movieList.winControl.selection.getItems().then(function (items) { // Clear the template container movieDetails.innerHTML = ""; // Render the template detailsTemplate.winControl.render(items[0].data, movieDetails); }); } }); } }; app.start(); })();   Here is the movies.js file: (function () { "use strict"; var movies = new WinJS.Binding.List([ { title: "Star Wars", director: "Lucas"}, { title: "Shrek", director: "Adamson" }, { title: "Star Trek", director: "Abrams" }, { title: "Spiderman", director: "Raimi" }, { title: "Memento", director: "Nolan" }, { title: "Minority Report", director: "Spielberg" } ]); // Expose the data source WinJS.Namespace.define("ListViewDemos", { movies: movies }); })();   Summary The purpose of this blog entry was to describe how to create a simple master/detail view by taking advantage of the WinJS ListView control. We handled the selectionchanged event of the ListView control to display movie details when you select a movie in the ListView.

    Read the article

  • Metro: Creating a Master/Detail View with a WinJS ListView Control

    - by Stephen.Walther
    The goal of this blog entry is to explain how you can create a simple master/detail view by using the WinJS ListView and Template controls. In particular, I explain how you can use a ListView control to display a list of movies and how you can use a Template control to display the details of the selected movie. Creating a master/detail view requires completing the following four steps: Create the data source – The data source contains the list of movies. Declare the ListView control – The ListView control displays the entire list of movies. It is the master part of the master/detail view. Declare the Details Template control – The Details Template control displays the details for the selected movie. It is the details part of the master/detail view. Handle the selectionchanged event – You handle the selectionchanged event to display the details for a movie when a new movie is selected. Creating the Data Source There is nothing special about our data source. We initialize a WinJS.Binding.List object to represent a list of movies: (function () { "use strict"; var movies = new WinJS.Binding.List([ { title: "Star Wars", director: "Lucas"}, { title: "Shrek", director: "Adamson" }, { title: "Star Trek", director: "Abrams" }, { title: "Spiderman", director: "Raimi" }, { title: "Memento", director: "Nolan" }, { title: "Minority Report", director: "Spielberg" } ]); // Expose the data source WinJS.Namespace.define("ListViewDemos", { movies: movies }); })(); The data source is exposed to the rest of our application with the name ListViewDemos.movies. Declaring the ListView Control The ListView control is declared with the following markup: <div id="movieList" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.movies.dataSource, itemTemplate: select('#masterItemTemplate'), tapBehavior: 'directSelect', selectionMode: 'single', layout: { type: WinJS.UI.ListLayout } }"> </div> The data-win-options attribute is used to set the following properties of the ListView control: itemDataSource – The ListView is bound to the list of movies which we created in the previous section. Notice that the ListView is bound to ListViewDemos.movies.dataSource and not just ListViewDemos.movies. itemTemplate – The item template contains the template used for rendering each item in the ListView. The markup for this template is included below. tabBehavior – This enumeration determines what happens when you tap or click on an item in the ListView. The possible values are directSelect, toggleSelect, invokeOnly, none. Because we want to handle the selectionchanged event, we set tapBehavior to the value directSelect. selectionMode – This enumeration determines whether you can select multiple items or only a single item. The possible values are none, single, multi. In the code above, this property is set to the value single. layout – You can use ListLayout or GridLayout with a ListView. If you want to display a vertical ListView, then you should select ListLayout. You must associate a ListView with an item template if you want to render anything interesting. The ListView above is associated with an item template named #masterItemTemplate. Here’s the markup for the masterItemTemplate: <div id="masterItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="movie"> <span data-win-bind="innerText:title"></span> </div> </div> This template simply renders the title of each movie. Declaring the Details Template Control The details part of the master/detail view is created with the help of a Template control. Here’s the markup used to declare the Details Template control: <div id="detailsTemplate" data-win-control="WinJS.Binding.Template"> <div> <div> Title: <span data-win-bind="innerText:title"></span> </div> <div> Director: <span data-win-bind="innerText:director"></span> </div> </div> </div> The Details Template control displays the movie title and director.   Handling the selectionchanged Event The ListView control can raise two types of events: the iteminvoked and selectionchanged events. The iteminvoked event is raised when you click on a ListView item. The selectionchanged event is raised when one or more ListView items are selected. When you set the tapBehavior property of the ListView control to the value “directSelect” then tapping or clicking a list item raised both the iteminvoked and selectionchanged event. Tapping a list item causes the item to be selected and the item appears with a checkmark. In our code, we handle the selectionchanged event to update the movie details Template when you select a new movie. Here’s the code from the default.js file used to handle the selectionchanged event: var movieList = document.getElementById("movieList"); var detailsTemplate = document.getElementById("detailsTemplate"); var movieDetails = document.getElementById("movieDetails"); // Setup selectionchanged handler movieList.winControl.addEventListener("selectionchanged", function (evt) { if (movieList.winControl.selection.count() > 0) { movieList.winControl.selection.getItems().then(function (items) { // Clear the template container movieDetails.innerHTML = ""; // Render the template detailsTemplate.winControl.render(items[0].data, movieDetails); }); } }); The code above sets up an event handler (listener) for the selectionchanged event. The event handler first verifies that an item has been selected in the ListView (selection.count() > 0). Next, the details for the movie are rendered using the movie details Template (we created this Template in the previous section). The Complete Code For the sake of completeness, I’ve included the complete code for the master/detail view below. I’ve included both the default.html, default.js, and movies.js files. Here is the final code for the default.html file: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ListViewMasterDetail</title> <!-- WinJS references --> <link href="//Microsoft.WinJS.0.6/css/ui-dark.css" rel="stylesheet"> <script src="//Microsoft.WinJS.0.6/js/base.js"></script> <script src="//Microsoft.WinJS.0.6/js/ui.js"></script> <!-- ListViewMasterDetail references --> <link href="/css/default.css" rel="stylesheet"> <script src="/js/default.js"></script> <script type="text/javascript" src="js/movies.js"></script> <style type="text/css"> body { font-size: xx-large; } .movie { padding: 5px; } #masterDetail { display: -ms-box; } #movieList { width: 300px; margin: 20px; } #movieDetails { margin: 20px; } </style> </head> <body> <!-- Templates --> <div id="masterItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="movie"> <span data-win-bind="innerText:title"></span> </div> </div> <div id="detailsTemplate" data-win-control="WinJS.Binding.Template"> <div> <div> Title: <span data-win-bind="innerText:title"></span> </div> <div> Director: <span data-win-bind="innerText:director"></span> </div> </div> </div> <!-- Master/Detail --> <div id="masterDetail"> <!-- Master --> <div id="movieList" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.movies.dataSource, itemTemplate: select('#masterItemTemplate'), tapBehavior: 'directSelect', selectionMode: 'single', layout: { type: WinJS.UI.ListLayout } }"> </div> <!-- Detail --> <div id="movieDetails"></div> </div> </body> </html> Here is the default.js file: (function () { "use strict"; var app = WinJS.Application; app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { WinJS.UI.processAll(); var movieList = document.getElementById("movieList"); var detailsTemplate = document.getElementById("detailsTemplate"); var movieDetails = document.getElementById("movieDetails"); // Setup selectionchanged handler movieList.winControl.addEventListener("selectionchanged", function (evt) { if (movieList.winControl.selection.count() > 0) { movieList.winControl.selection.getItems().then(function (items) { // Clear the template container movieDetails.innerHTML = ""; // Render the template detailsTemplate.winControl.render(items[0].data, movieDetails); }); } }); } }; app.start(); })();   Here is the movies.js file: (function () { "use strict"; var movies = new WinJS.Binding.List([ { title: "Star Wars", director: "Lucas"}, { title: "Shrek", director: "Adamson" }, { title: "Star Trek", director: "Abrams" }, { title: "Spiderman", director: "Raimi" }, { title: "Memento", director: "Nolan" }, { title: "Minority Report", director: "Spielberg" } ]); // Expose the data source WinJS.Namespace.define("ListViewDemos", { movies: movies }); })();   Summary The purpose of this blog entry was to describe how to create a simple master/detail view by taking advantage of the WinJS ListView control. We handled the selectionchanged event of the ListView control to display movie details when you select a movie in the ListView.

    Read the article

  • Hot to get website/product reviews reflected in Google's search results using review-aggregate format

    - by BasP
    I am managing a website called Rent A Boat Amsterdam. We have a system that gathers reviews from people that have used our services and that publishes these customer reviews making them available for all website visitors. When these customer reviews are published we have placed them within the appropriate tags according to the guidelines set by Google, which you can find here. An example looks like this: <li class="" style="clear:both;"> <div class="hreview"> <div class="item" style="display:none;"><span class="fn">Boatname</span></div> <div style="border:1px solid #DEDEDE; background-color:#D9FFD4; margin:0 10px 10px 0; float:left; text-align:center; padding:10px; height:50px; width:70px;"><h1><span class="rating">10</span></h1>9-Jun-2010</div> <div> <div class="description"><p>Great canal Cruise!</p></div> <p class="reviewer vcard"><strong><span class="fn">First name Last name</span></strong></p> </div> </div> We have implemented these tags a couple of months ago, but there are no visible results in the Google SERP's. This whilst I had expected to find the reviews / ratings displayed similar to: Is anyone familiar with this topic and able to help me find the answer to the question why the review-aggregate format doesn't seem to have the desired effect?

    Read the article

  • images within noscript

    - by Guilherme Nascimento
    Note: My question is not about javascript Note: My question is how to make the HTML accessible to search engines. Note: My question is not about hiding texts, is on block loading of images in order to use LazyLoad. I tested various techniques of blocking the loading of images to use effect LazyLoad (I'm developing in javascript), was the only efficient <NOSCRIPT>: The HTML structure that would, with LazyLoad loading of images is achieved via the viewport (visible area of the website in browser). <p>Lorem ipsum dolor sit amet, <span class="lazyload"> <noscript><img src="foto-m0101.jpg" alt="image description"></noscript> </span> consectetur adipiscing elit. </p> <p>Lorem ipsum dolor sit amet, <span class="lazyload"> <noscript><img src="foto-m0201.jpg" alt="image description"></noscript> </span> consectetur adipiscing elit. </p> <p>Lorem ipsum dolor sit amet, <span class="lazyload"> <noscript><img src="foto-m0301.jpg" alt="image description"></noscript> </span> consectetur adipiscing elit. </p> This is a bad practice for search engines? If it is a bad practice, you could put an example of good practice? If there is any other issue with noscript talking pictures, forgive me. Note: I did not find any doubts about noscript with images.

    Read the article

  • Redirecting to a dynamic page

    - by binarydev
    I have a page displaying blog posts (latest_posts.php) and another page that display single blog posts (blog.php) . I intend to link the image title in latest_posts.php so that it redirects to blog.php where it would display the particular post that was clicked. latest_posts.php: <!-- Header --> <h2 class="underline"> <span>What&#039;s new</span> <span></span> </h2> <!-- /Header --> <!-- Posts list --> <ul class="post-list post-list-1"> <?php /* Fetches Date/Time, Post Content and title */ include 'dbconnect.php'; $sql = "SELECT * FROM wp_posts"; $res = mysql_query($sql); while ( $row = mysql_fetch_array($res) ) { ?> <!-- Post #1 --> <li class="clear-fix"> <!-- Date --> <div class="post-list-date"> <div class="post-date-box"> <?php //Timestamp broken down to show accordingly $timestamp = $row['post_date']; $datetime = new DateTime($timestamp); $date = $datetime->format("d"); $month = $datetime->format("M"); ?> <h3> <?php echo $date; ?> </h3> <span> <?php echo $month; ?> </span> </div> </div> <!-- /Date --> <!-- Image + comments count --> <div class="post-list-image"> <!-- Image --> <div class="image image-overlay-url image-fancybox-url"> <a href="post.php" class="preloader-image"> <?php echo '<img src="', $row['image'], '" alt="' , $row['post_title'] , '\'s Blog Image" />'; ?> </a> </div> <!-- /Image --> </div> <!-- /Image + comments count --> <!-- Content --> <div class="post-list-content"> <div> <!-- Header --> <h4> <a href="post.php? . $row['ID'] . "> <?php echo $row['post_title']; ?> </a> </h4> <!-- /Header --> <!-- Excerpt --> <p> <?php echo $row ['post_content']; }?> </p> <!-- /Excerpt --> </div> </div> <!-- /Content --> </li> <!-- /Post #1 --> </ul> <!-- /Posts list --> <a href="blog.php" class="button-browse">Browse All Posts</a> </div> <?php require_once('include/twitter_user_timeline.php'); ?> blog.php: <?php require_once('include/header.php'); ?> <body class="blog"> <?php require_once('include/navigation_bar_blog.php'); ?> <div class="blog"> <div class="main"> <!-- Header --> <h2 class="underline"> <span>What&#039;s new</span> <span></span> </h2> <!-- /Header --> <!-- Layout 66x33 --> <div class="layout-p-66x33 clear-fix"> <!-- Left column --> <!-- <div class="column-left"> --> <!-- Posts list --> <ul class="post-list post-list-2"> <?php /* Fetches Date/Time, Post Content and title with Pagination */ include 'dbconnect.php'; //sets to default page if(empty($_GET['pn'])){ $page=1; } else { $page = $_GET['pn']; } // Index of the page $index = ($page-1)*3; $sql = "SELECT * FROM `wp_posts` ORDER BY `post_date` DESC LIMIT " . $index . " ,3"; $res = mysql_query($sql); //Loops through the values while ( $row = mysql_fetch_array($res) ) { ?> <!-- Post #1 --> <li class="clear-fix"> <!-- Date --> <div class="post-list-date"> <div class="post-date-box"> <?php //Timestamp broken down to show accordingly $timestamp = $row['post_date']; $datetime = new DateTime($timestamp); $date = $datetime->format("d"); $month = $datetime->format("M"); ?> <h3> <?php echo $date; ?> </h3> <span> <?php echo $month; ?> </span> </div> </div> <!-- /Date --> <!-- Image + comments count --> <div class="post-list-image"> <!-- Image --> <div class="image image-overlay-url image-fancybox-url"> <a href="post.php" class="preloader-image"> <?php echo '<img src="', $row['image'], '" alt="' , $row['post_title'] , '\'s Blog Image" />'; ?> </a> </div> <!-- /Image --> </div> <!-- /Image + comments count --> <!-- Content --> <div class="post-list-content"> <div> <?php $id = $_GET['ID']; $post = lookup_post_somehow($id); if($post) { // render post } else { echo 'blog post not found..'; } ?> <!-- Header --> <h4> <a href="post.php"> <?php echo $row['post_title']; ?> </a> </h4> <!-- /Header --> <!-- Excerpt --> <p> <?php echo $row ['post_content']; ?> </p> <!-- /Excerpt --> </div> </div> <!-- /Content --> </li> <!-- /Post #1 --> <?php } // close while loop ?> </ul> <!-- /Posts list --> <div><!-- Pagination --> <ul class="blog-pagination clear-fix"> <?php //Count the number of rows $numberofrows = mysql_query("SELECT COUNT(ID) FROM `wp_posts`"); //Do ciel() to round the result according to number of posts $postsperpage = 4; $numOfPages = ceil($numberofrows / $postsperpage); for($i=1; $i < $numOfPages; $i++) { //echos links for each page $paginationDisplay = '<li><a href="blog.php?pn=' . $i . '">' . $i . '</a></li>'; echo $paginationDisplay; } ?> <!-- <li><a href="#" class="selected">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> --> </ul> </div><!-- /Pagination --> <!-- /div> --> <!-- Left column --> </div> <!-- /Layout 66x33 --> </div> </div> <?php require_once('include/twitter_user_timeline.php'); ?> <?php require_once('include/footer_blog.php'); ?> How do I render?

    Read the article

  • Adding binary checkbox values to MySQL database using PHP

    - by klyv
    I'm new to PHP, and I am creating a basic CMS using PHP and MySQL. I'm struggling to get the checkbox information from my HTML page across into the database. How can I make the values to appear as binary 0 or 1 values? The HTML document is written as follows: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Create your news page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <fieldset> <legend>Checked components will show in the page</legend> <form method="POST" action="http://*********.php"> <span class="label">Header</span> <input type="checkbox" name="header" value="HEADER"> <br> <span class="label">Footer</span> <input type="checkbox" name="footer" value="FOOTER"> <hr> <span class="label">Local news</span> <input type="checkbox" name="local" value="LOCALNEWS"> <br> <span class="label">National news</span> <input type="checkbox" name="national" value="NATIONALNEWS"> <br> <span class="label">International news</span> <input type="checkbox" name="international" value="INTERNATIONALNEWS"> <p> <input type="submit"> </form> </fieldset> </body> </html> And the PHP document is written as follows: <?php $user="user_***"; $password="*********"; $database="dbxyz"; mysql_connect("localhost", $user, $password); mysql_select_db($database, $db_handle); mysql_select_db("dbxyz"); if(isset($_POST['layout'])) { foreach($_POST['layout'] as $value { $insert="INSERT INTO layout (header, footer, local, national, international) VALUES ('$value')"; mysql_query($insert); } } ?>

    Read the article

  • Help with jQuery Traversal

    - by Jack Webb-Heller
    Hi guys, I'm struggling a bit with traversing in jQuery. Here's the relevant markup: <ul id="sortable" class="ui-sortable"> <li> <img src="http://ecx.images-amazon.com/images/I/51Vza76tCxL._SL160_.jpg"> <div class="controls"> <span class="move">?</span> <span class="delete">?</span> </div> <div class="data"> <h1>War and Peace (Oxford World's Classics)</h1> <textarea>Published to coincide with the centenary of Tolstoy's death, here is an exciting new edition of one of the great literary works of world literature.</textarea> </div> </li> <li> <img src="http://ecx.images-amazon.com/images/I/51boZxm2seL._SL160_.jpg"> <div class="controls"> <span class="move">?</span> <span class="delete">?</span> </div> <div class="data"> <h1>A Christmas Carol and Other Christmas Writings (Penguin Classics)</h1> <span>Optionally, write your own description in the box below.</span> <textarea>Dicken's Christmas writings-in a new, sumptuous, and delightful clothbound edition.</textarea> </div> </li> </ul> This is code for a jQuery UI 'Sortable' element. Here's what I want to happen. When the Delete thing is clicked ($('.delete')), I want the <li> item it's contained within to be removed. I've tried using $('.delete').parent().parent().remove(); but in the case of having two items, that seems to delete both of them. I'm a bit confused by this. I also tried using closest() to find the closest li, but that didn't seem to work either. How should I best traverse the DOM in this case? Thanks! Jack

    Read the article

  • jquery anchor to html extract

    - by Benjamin Ortuzar
    I would like to implement something similar to the Google quick scroll extension with jquery for the extracts of a search result, so when the full document is opened (within the same website) it gives the user the opportunity to go straight to the extract location. Here is a sample of what I get returned from the search engine when I search for 'food'. <doc> <docid>129305</docid> <title><span class='highlighted'>Food</span></title> <summary> <summarytext>Papers subject to Negative Resolution: 4 <span class='highlighted'>Food</span> <span class='highlighted'>Food</span> Irradiation (England) Regulations 2009 (S.I., 2009, No. 1584), dated 24 June 2009 (by Act), </summarytext> </summary> <paras> <paraitemcount>2</paraitemcount> <para> <paraitem>1</paraitem> <paraid>42</paraid> <pararelevance>100</pararelevance> <paraweights>50</paraweights> <paratext>4 <span class='highlighted'>Food</span></paratext> </para> <para> <paraitem>2</paraitem> <paraid>54</paraid> <pararelevance>100</pararelevance> <paraweights>50</paraweights> <paratext><span class='highlighted'>Food</span> Irradiation (England) Regulations 2009 (S.I., 2009, No. 1584), dated 24 June 2009 (by Act), with an Explanatory Memorandum and an Impact Assessment (</paratext> </para> </paras> </doc> As you see the search engine has returned a document that contains one summary and two extracts. So let's say the user clicks on the second extract in the search resutls page, the browser would open the detailed document in the same website, and would offer the user the possibility to go to the extract as the Google quick scroll extension does. Is there an existing jquery script for this? If not, can you suggest any jquery/javascript code that would simplify my task to implement this. Notes: I can access the extracts from the document details page. I'm aware that the HTML in some cases could be slightly different in the extract than in the details page, finding no match. The search engine does not return where the extract was located. At the moment I'm trying to understand the JS code that the extension uses.

    Read the article

  • JQUERY Ajax form, page refreshs & isn't supposed to in Safari, doesn't refresh in FF (works fine)

    - by nobosh
    I'm working on a AJAX form which lives in a JQUERY UI Dialog. It works great in FireFox, but for some reason, in safari it refreshes the page to: /? Please let me know if somethings wrong here? Thanks <div class="modal-container"> <form onsubmit="" action="" id="list-dialog-form" name="list-dialog-form"> <div id="modal-wrapper"> <br><br> <div class="modal-inputbar"> <span style="width: 100px;" class="inputbar-label"> <label>Edit List Name:</label> </span> <span style="width: 200px;" class="inputbar-input"> <input type="text" style="padding-right: 25px;" autocomplete="off" maxlength="140" id="listname" value="Untitled"> </span> </div> </div> <div id="modal-submit" class="modal-submit"> <span class="left delete-wrap"> <span onclick="deleteThisList(15);" class="delete"> </span> </span> <span style="line-height: 2em;" class="right"> <input type="hidden" value="15" id="tasklistID"> <input type="submit" value="update" id="dialogcloser"> <input type="button" onclick="$('#listeditdialog').dialog('close');" value="close" id="dialogcloser"> </span> </div> </form> </div> // Handles Updating the List Title $("#list-dialog-form").submit(function(){ // Ajax Spinner $("#listname").css("background", "url('/images/ajax-loader.gif') no-repeat scroll 98% center #FFF"); $.ajax({ url: '/ajax/listname-update/index.cfm', data: ({listname: $("#listname").val().trim(), tasklistID: $("#tasklistID").val()}), dataType: 'json', type: 'post', success: function( result ) { // Update the name in the top, project list $("#list-" + $("#tasklistID").val()).find('a').html($("#listname").val().trim()); $("#list-" + $("#tasklistID").val()).effect('highlight', {color: '#BDC1C7'}, 500); //Remove the Ajax Spinner $("#listname").css("background", "#FFF"); $("#listname").effect('highlight', {color: '#BDC1C7'}, 500); //close the dialog $('#listeditdialog').dialog('close'); } }); return false; });

    Read the article

  • mvc4 receive form in a controller

    - by Marco Dinatsoli
    i have a form in html and i want to submit it to a controler what i have tried @using (Html.BeginForm("RegisterApartmentOwner", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) { <p> <label>First Name</label> <input type="text" placeholder="Enter your first Name" name="firstName" /> <span class="errorMessage"></span> </p> <p> <label>Last Name</label> <input type="text" placeholder="Enter your last Name" /> <span class="errorMessage"></span> </p> <p> <label>Password</label> <input type="text" placeholder="Enter your password" name="Password"/> <span class="errorMessage"></span> </p> <p> <label>Password Again</label> <input type="text" placeholder="Enter your password again" name="Password2"/> <span class="errorMessage"></span> </p> <p> <label>Mobile Number</label> <input type="text" placeholder="Enter your mobile number" /> <span class="errorMessage"></span> </p> <p> <input type="submit" value="Register" class="submit"/> </p> } </div> and in the controller i receive the submit in this function public String RegisterTenant() { return "done"; } i can see the done message, however, i want to receive the values of the input that i used in the form, how please? i just to know what to receive the form in the controller

    Read the article

  • css coding on Myspace - Problem

    - by Frederik Wessberg
    Hey Folks. I've read what I could, and I'm certainly no master, but I'm fixing up a colleagues profile on myspace.com, and im working with 2 divs in each side of the screen, and I want them to align so that they are next to each other. I've tried float: left; and float: right;, and I've tried margin: right; on div 1 and such. Could you help? Here's the site: http://www.myspace.com/jonasjohansen This is info for div1: <div class="textBox" align="left" style="width: 290px; word-wrap:break-word"> <span class="orangetext15"> BANDS </span> <b>MOVE</b><br /> Fredrik ....balbalbalbla </div> <style> .textBox { position: relative; left:-320px; top:0px; width: 290px; height: 350px; overflow-y: visible; overflow-x: visible; top: YYYpx; z-index: 3; background-color: transparent; border:none; } </style> This is info for div2: <style>.i {display:none;}{!-eliminate bio header!-}table table td.text table td.text {display:none;}{!-recover in shows and friends-!}table table td.text div table td.text,table table td.text table.friendSpace td.text {display:inline;}{! move up our custom section. You may change px value !}div.myDivR {position:relative; top:0px; margin-bottom:-300px; }{! you can apply style to the custom div !}div.myDivR {background-color:white; border:2px solid; border-color:darkgreen; float: right;}</style></td></tr></table></td></tr></table><span class="off">Re-Open Bio Table give it our own Class </span><table class="myBio" style="width:435px;"><tr><i class="i"></i><td class="myBioHead" valign="center" align="left" width="auto" bgcolor="ffcc99" height="17"> &nbsp;&nbsp;<span class="orangetext15"> ABOUT JONAS JOHANSEN</span> </td></tr><tr><td><table class="myBioI"><tr><td><span class="off"></span> blalbalbalbalbla <span class="off">END Bio Content </span>

    Read the article

  • use jQuery to get 'true size' of image without removing the class

    - by jon3laze
    I am using Jcrop on an image that is resized with css for uniformity. JS <script type="text/javascript"> $(window).load(function() { //invoke Jcrop API and set options var api = $.Jcrop('#image', { onSelect: storeCoords, trueSize: [w, h] }); api.disable(); //disable until ready to use //enable the Jcrop on crop button click $('#crop').click(function() { api.enable(); }); }); function storeCoords(c) { $('#X').val(c.x); $('#Y').val(c.y); $('#W').val(c.w); $('#H').val(c.h); }; </script> HTML <body> <img src="/path/to/image.jpg" id="image" class="img_class" alt="" /> <br /> <span id="crop" class="button">Crop Photo</span> <span id="#X" class="hidden"></span> <span id="#Y" class="hidden"></span> <span id="#W" class="hidden"></span> <span id="#H" class="hidden"></span> </body> CSS body { font-size: 13px; width: 500px; height: 500px; } .image { width: 200px; height: 300px; } .hidden { display: none; } I need to set the h and w variables to the size of the actual image. I tried using the .clone() manipulator to make a copy of the image and then remove the class from the clone to get the sizing but it sets the variables to zeros. var pic = $('#image').clone(); pic.removeClass('image'); var h = pic.height(); var w = pic.width(); It works if I append the image to an element in the page, but these are larger images and I would prefer not to be loading them as hidden images if there is a better way to do this. Also removing the class, setting the variables, and then re-adding the class was producing sporadic results. I was hoping for something along the lines of: $('#image').removeClass('image', function() { h = $(this).height(); w = $(this).width(); }).addClass('image'); But the removeClass function doesn't work like that :P

    Read the article

  • Sliding panel in the middle of the page. Z-index given not working

    - by Nehal Rupani
    Hi all, I am implementing sliding panel element but problem is when i slide out other div element is floating down. I guess and tried to give z-index to element which i am sliding but it doesn't seems to work. Let me put code for both div. <div class="vrcontrol"> <div class="slide-out-div"> <a class="handle" href="http://link-for-non-js-users.html">Content</a> <h3>Contact me</h3> <p>Thanks for checking out my jQuery plugin, I hope you find this useful. </p> <p>This can be a form to submit feedback, or contact info</p> </div> This is div which i am sliding in and out and beneath is code of effective div. <div class="askform"> <p class="titletext">Ask an Expert Trade Forum</p> <p class="detailtext">WD-40’s leading source for DIY tips and tricks.</p> <span> <form id="askform" name="askform" action="" method="post"> <span class="left"><input name="input" type="text" class="askinputbox"/></span><span class="marginleft"><input type="image" src="images/search_icon.gif" /></span> </form> </span> <div class="followus"> <span class="followtext">Follow us on</span><span class="right"><img src="images/bookmark.jpg" width="121" height="45" alt="Bookmark" /></span> </div> </div> Sliding div is in left portion of the page and effective div is in right portion of the page. I guess something with z-index, positioning element and overflow properties will do something.

    Read the article

  • jquery use of :last and val()

    - by dole doug
    I'm trying to run the code from http://jsfiddle.net/ddole/AC5mP/13/ on my machine and the approach I've use is below or here. Do you know why that code doesn't work on my machine. Firebug doesn't help me and I can't solve the problem. I think that I need another pair of eyes :((( <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Dialog - Modal form</title> <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script> <script type="text/javascript" > jQuery(function($) { $('.helpDialog').hide(); $('.helpButton').each(function() { $.data(this, 'dialog', $(this).next('.helpDialog').dialog({ autoOpen: false, modal: true, width: 300, height: 250, buttons: { "Save": function() { alert($('.helpText:last').val()); $(this).dialog( "close" ); }, Cancel: function() { $(this).dialog( "close" ); } } }) ); }).click(function() { $.data(this, 'dialog').dialog('open'); return false; }); }); </script> </head> <body> <span class="helpButton">Button</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 2</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 3</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 4</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> <span class="helpButton">Button 5</span> <div class="helpDialog"> <input type="text" class="helpText" /> </div> </body>

    Read the article

  • How to detect Links with out anchor element in a plain text

    - by dhee
    If user enters his text in the text box and saves it and again what's to add some more text he can edit that text and save it if required. Firstly if user enters that text with some links I, detected them and converted any hyperlinks to linkify in new tab. Secondly if user wants to add some more text and links he clicks on edit and add them and save it at this time I must ignore the links that already hyperlinked with anchor button Please help and advice For example: what = "<span>In the task system, is there a way to automatically have any site / page URL or image URL be hyperlinked in a new window?</span><br><br><span>So If I type or copy http://www.stackoverflow.com/&nbsp; for example anywhere in the description, in any of the internal messages or messages to clients, it automatically is a hyperlink in a new window.</span><br><a href="http://www.stackoverflow.com/">http://www.stackoverflow.com/</a><br> <br><span>Or if I input an image URL anywhere in support description, internal messages or messages to cleints, it automatically is a hyperlink in a new window:</span><br> <span>https://static.doubleclick.net/viewad/4327673/1-728x90.jpg</span><br><br><a href="https://static.doubleclick.net/viewad/4327673/1-728x90.jpg">https://static.doubleclick.net/viewad/4327673/1-728x90.jpg</a><br><br><br><span>This would save us a lot time in task building, reviewing and creating messages.</span> Test URL's http://www.stackoverflow.com/ http://stackoverflow.com/ https://stackoverflow.com/ www.stackoverflow.com //stackoverflow.com/ <a href='http://stackoverflow.com/'>http://stackoverflow.com/</a>"; I've tried this code function Linkify(what) { str = what; out = ""; url = ""; i = 0; do { url = str.match(/((https?:\/\/)?([a-z\-]+\.)*[\-\w]+(\.[a-z]{2,4})+(\/[\w\_\-\?\=\&\.]*)*(?![a-z]))/i); if(url!=null) { // get href value href = url[0]; if(href.substr(0,7)!="http://") href = "http://"+href; // where the match occured where = str.indexOf(url[0]); // add it to the output out += str.substr(0,where); // link it out += '<a href="'+href+'" target="_blank">'+url[0]+'</a>'; // prepare str for next round str = str.substr((where+url[0].length)); } else { out += str; str = ""; } } while(str.length>0); return out; } Please help Thanks.

    Read the article

  • Retrieving the Selected value dynamically in JQuery

    - by Chakradhar
    i have this html, this is generated dynamically based on question number <fieldset id="selectfield"> <label class="select">What ur is Profession? </label> <br> <div class="ui-select"><a href="#" role="button" id="72+_select-button" aria-haspopup="true" aria-owns="72+_select-menu" data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-hover-c ui-btn-up-c"><span class="ui-btn-inner ui-btn-corner-all" aria-hidden="true"><span class="ui-btn-text">Business</span><span class="ui-icon ui-icon-arrow-d ui-icon-shadow"></span></span></a> <select name="selectedObjects" id="72+_select" data-native-menu="false" tabindex="-1"> <option value="-1">--Select--</option> <option value="769">Salaried</option> <option selected="selected" value="770">Business</option> <option value="771">Self Emp</option> </select></div> </fieldset> click button is <div data-theme="c" class="ui-btn ui-btn-corner-all ui-shadow ui-btn-hover-c ui-btn-up-c" aria-disabled="false"><span class="ui-btn-inner ui-btn-corner-all" aria-hidden="true"><span class="ui-btn-text">Next</span></span> <input type="submit" id="72+_b" onclick="return SaveDropDown(this);" value="Next" class="ui-btn-hidden" aria-disabled="false"> </div> i have written this JS in SaveDropDown(this) function SaveDropDown(button) { var fieldsetName = getQuestionName(button.id)+'+_select'; var select = $(fieldsetName +"option:selected").val(); return false; } the questionname function is function getQuestionName(buttonid) { var splitstr = buttonid.split('+'); var fieldsetName = '#' + splitstr[0]; return fieldsetName; } but its returning the undefined how do i retrieve the select value dynamically. any help is appreciated.

    Read the article

  • Javascript E4X - Return the text of node and its children?

    - by Chris
    I'm trying to parse some of html where there is are repeating lines of code such as: <a>This is <span>some text</span> but its <span>not grabbing the span</span> content</a> So I am looping through the object and extracting this: object.a[i].text(); but its only returning "This is but its content" How do I grab the text within the children nodes as well, all as one string? Cheers

    Read the article

  • JQM dialog is opening in new page instead of dialog

    - by K D
    Thank you for taking the time to read my question. I'm trying to get a dialog box to open using Jquery mobile. I followed the documentation and used the data-rel="dialog" notation along with the data-transition="pop". Instead of a dialog appearing on the same page, I get a brand new page with the dialog appearing. Can someone kindly assist me on how to fix this functionality. Here is my code for the initial main page: <article> <ul data-role="listview" data-split-icon="star" data-split-theme="d" data-inset="true"> <li><a href="#black_seed_desc" data-rel="dialog" ><img src="black_seed.jpg"/> <h3>Black Seed Oil</h3> </a> <a href="#black_seed_purchase" data-rel="dialog" data-transition="pop">Purchase Black Seed Oil</a> </li> </ul> </article> Here is my code for the dialog page: <div data-role="dialog" id="black_seed_purchase" data-theme="c"> <section data-role="content"> <h1>Purchase Black Seed Oil?</h1> <p>By purchasing Black Seed Oil you will receive an email receipt copy sent to you for your reference.</p> <a href="#purchase_blackseed" data-inline="true" data-corners="true" data-rel="back" data-role="button" data-shadow="true" data-iconshadow="true" data-wrapperrels="span"> <span> <span>Buy: $49.99</span> <span>&nbsp;</span> </span> </a> <a href="#" data-role="button" data-rel="back" data-inline="true" data-corners="true" data-wrapperrels="span" data-shadow="true" data-iconshawdow="true"> <span> Cancel </span> </a> </section> </div> Here is a working example. http://jsfiddle.net/Gajotres/w3ptm/?

    Read the article

  • How can I convince IE to honor my explicit instructions to make a table column X pixels wide? [migrated]

    - by AnthonyWJones
    Please consider this small but complete chunk of HTML: <!DOCTYPE html > <html> <head> <title>Test</title> <style type="text/css"> span {overflow:hidden; white-space:nowrap; } td {overflow:hidden; text-overflow:ellipsis} </style> </head> <body> <table cellspacing="0" > <tbody> <tr> <td nowrap="nowrap" style="max-width:30px; width:30px; white-space:nowrap; "><span>column 1</span></td> <td nowrap="nowrap" style="max-width:30px; width:30px; white-space:nowrap; "><span>column 2</span></td> <td nowrap="nowrap" style="max-width:30px; width:30px; white-space:nowrap; "><span>column 3</span></td> </tr> </tbody> </table> </body> </html> If you render the above in Chrome you'll see the effect I'm looking for. However render it in IE8 or 9 the width and/or max-width is ignored. So my question is how do get IE to simply let me specify the width of a cell explicitly? BTW, I've tried various combinations of table-layout:fixed and using colgroup with cols and all sorts, nothing I've tried convinces IE to what I'm clearly asking it to explicitly do? If I had any hair before starting this I wouldn't have any left by now.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >