w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
jQuery UI Draggable Dynamic Content
You only use val() for input elements otherwise you should use html() So you code should be: var name = $(this).find('td').first().html();

Categories : Jquery

Draggable no longer working after content made dynamic
function initDraggable(c){ $(c).draggable(); } $.ajax{ ........ success:function(){ initDraggable($(".draggable-item")); } } After ajax , call init function again

Categories : Jquery

How to set content in SlidingDrawer draggable like handle?
I know this is a late reply but I've been having a similar problem and have found a solution that should work for static content views. It won't work if you need to check for touch events in the content area but if you just have static text/images that don't change it should work. I copied the source code file and basically just add the code below to the public boolean onInterceptTouchEvent(MotionEvent event) method. Basically it just adds the content are to the acceptable area for dragging. /* Within the onInterceptTouchEvent() method (Line 341) */ final Rect frame = mFrame; final View handle = mHandle; final View content = mContent; handle.getHitRect(frame); content.getHitRect(frame); /* Source continued below */ Unfortunately I haven't found a solid solution if your content area

Categories : Misc

Dynamic Knockout Javascript Table with Draggable columns danvk
This library initializes on document load. Any changes to the HTML it had access to at document load will most likely break it's behavior. Take a look at the project's issues on google code and you'll find a discussion regarding your exact same problem.

Categories : Javascript

jQuery UI draggable doesn't inject when using an ajax content refresh
hope this helps, Put all your event binders inside one function and then call that function: function wrapper(){ $('.postit').draggable( { start: function(){ $(this).css("z-index", a++); }, stop: function(){ var offset = $(this).offset(); var xPos = offset.left; var yPos = offset.top; var pid = $(this).attr('id'); var datastring = 'xpos=' + xPos + ' ypos=' + yPos + ' id=' + pid; $.ajax({ type: "POST", url: "savepositions.php", datatype: "text", data: {positions: datastring} }); } }); $('.postit').click(function(){ $(this).addClass('top').removeClass('bottom'); $(this).siblings().removeClass('top').addClass('bottom'); $(this).css("z-index", a++); }); } then: $(function(){ wrapper(); // This does the binding on page load }); and th

Categories : Jquery

C# Drag&Drop, hard time selecting draggable panel because of content
i think this link might help you... you would want to allow the children to drag and drop the parent control instead of moving your controls to the background of the panel

Categories : C#

JQuery Draggable: How do I make a draggable element snap to the inner-top of a div?
i'm not sure but it seems like jQueryUI doesn't support something like that. You could use this workaround to get the behaviour you need. Simply put another div in your div which is used for the snap. <div class='row'> <div class='innerHack'></div> </div> Here's a Fiddle

Categories : Jquery

create draggable div on click make the parrent draggable not the new div
You are applying the .draggable() at the wrong element. The .append() method returns the container element, not what you added. This should work: $('<div class="boxArt red" row="2" col="4" id="dragme3">DRAG ME3</div>').draggable().appendTo('#dropbtn');

Categories : Javascript

Make jQuery UI draggable element only draggable in down direction
$('#repel').mousemove(function () { var z = $(window).scrollTop(); var o = $('#repel').offset().top; var h = $('#repel').height(); $("#containment-wrapper").css({ top: o + h -2000 }); if (z < 10) { $("#containment-wrapper").css({ top: -850 }); } else { $("#containment-wrapper").css({ top: o + h -2000 }); } });

Categories : Javascript

jquery draggable & droppable get source container (that draggable came from)
You can use a variable which you set in the start event of the draggable and get that info in the stop event of the droppable. $(function () { var sourceElement; $("#Table1 tr:not(.disabled), #Table2 tr:not(.disabled), #Table3 tr:not(.disabled)").draggable({ helper: 'clone', revert: 'invalid', start: function (event, ui) { $(this).css('opacity', '.5'); //NEW sourceElement = $(this).closest('table').attr('id'); }, stop: function (event, ui) { $(this).css('opacity', '1'); } }); $("#Table1, #Table2, #Table3").droppable({ drop: function (event, ui) { $(ui.draggable).appendTo(this); //alert sourceElement alert($(ui.draggable).text() +

Categories : Jquery

XSL-FO footer in static-content but dynamic content?
Your code is not appropriately structured for dynamic content in static content. The concept you are missing is that your footer needs to "retrieve markers" that you set at points on the fly in the flow. One footer for all pages retrieves one marker class from the content of the pages and you change the marker at points in your flow and the retrieval obtains the most recent marker (or other options). So you need only a single footer that has your "Page x of y" bit, and you need to include a that retrieves a marker of a particular class. Then, in your flow, with all of your topics and sub-topics, and when you get to the first item of each you define a marker with the text you want to see in the footer. The XSL-FO output your XSLT needs to produce is along the lines of: <fo:sta

Categories : Xml

Jquery draggable element when cloned not draggable
call draggable() again for the cloned element after it is appended to the DOM function seCopyBox(x) { z = $('.seBox').eq(x).clone(); z.insertAfter($('.seBox').eq(x)).draggable(); } and i would go with clean jquery click function rather that inline javascript.. $(document).on('click','.seBox p',function(){ var x=$(this).closest('.seBox').index(); var z = $('.seBox').eq(x).clone(); z.insertAfter($('.seBox').eq(x)).draggable(); } remove the inline javascript and the seCopyBox function...

Categories : Jquery

Draggable helper -> drop clone at position of mouseup -> draggable clone
Here is a starting point: fiddle but this is a very general solution, so in case you have a more specific use case let me know ! .js $("#container").droppable({ // accept draggables only from #toolbox, // this will prevent cloning of the draggables(inside drop event handler), // that already have been dropped inside #container accept: "#toolbox .draggable", drop: function (event, ui) { // when a draggable is dropped: // 1: clone it's helper // 2: Make the helper draggable // 3: set containment to #container $(this).append($(ui.helper).clone().draggable({ containment: "parent" })); } }); $(".draggable").draggable({ revert: "invalid", helper: "clone" }); .html <div id="toolbox"> <div class="draggable">drag&l

Categories : Javascript

Keep Dynamic URL Content in URL on Each Page
There are a few ways you can do this. You may use $_SERVER['QUERY_STRING'] and put it in every single link in your page. It will keep your links always repeating the same query string that your current file is. You should try storing data in sessions! Then you can carry data from a page to another. Take a look at the PHP manual. Good luck!

Categories : PHP

Dynamic tab content and params
In tabs-directive.html, you can definitely use ngBindHtmlUnsafe. Make sure don't put {{}} around the variable. String: <div ng-bind-html-unsafe="tab.content"></div>

Categories : Angularjs

Dynamic detection of content
If you could add an id or a class to the parent element of those divs. <div id='wrapper'> <div> <div id ="title"> This is my Title</div> </div> <div id ="description"> This is Description</div> </div> You could: var title_html = $('.wrapper').find('div#title').html(); var desc_html = $('.wrapper').find('div#description').html(); And the you may check the values of those variables. In case the id is completely random but the structure is static you could: var contents_one = $('wrapper').children().get(0).children().get(0).html(); var contents_two = $('wrapper').children().get(1).html();

Categories : Javascript

using on() jquery for dynamic content
Use like this $(document).on('click', 'ul li.myclass', function(){ alert('ok'); }); Or even better ( opinion ) $("#fst").click(function(){ $("#ok").html("<ul class='ul'></ul>"); }); var li = $("<li class='myclass'>one</li><li class='myclass'>two</li>"); $("#snd").click(function(){ $(".ul").html(li); }); li.on('click', function() { alert('hi'); }); For overall better code write all of like similar to this $("#fst").click(function(){ $("#ok").html('').append( $('<ul>', {'class': 'ul'}) ); }); var li = $('<li>', { 'class': 'myClass', click: function() { alert('Hello'); } }), $("#snd").click(function(){ $(".ul").html('').append(li); }); I use append because it's quicker, tha

Categories : Jquery

Dynamic content from XML in SWF lost
If you want to include the XML directly into your ActionScript, it's just a matter of copy and paste: var xml:XML = your_xml_here; It can be pasted across multiple lines without any problems. As for the images, they'll need to be included in the SWF as well if you need it all to be self-contained (either via a SWC or by directly importing them into the FLA's library). I suspect this isn't going to be very good because if you have many images, the SWF is going to be very large and have a long load time. The other issue with this is that you're going to need to: Export each individual image as a class, via Flash's library interface. Update the XML to reference the class names, rather than the image paths. Implement a mechanic using getDefinitionByName() that uses the class names to cr

Categories : Xml

WPF : dynamic view/content
What you are describing sounds pretty close to a standard TabControl, but with a ControlTemplate that puts the tabs on the left side instead of above the content panel. Using this method would mean having a UserControl in each TabItem, eg. multiple controls. You can find out more about the TabControl from the TabControl Class page at MSDN.

Categories : Wpf

Dynamic content using jquery
Here is a JSFiddle with your animation working: http://jsfiddle.net/rzFzd/1. If the jQuery isn't loading properly, it is because your web service may be confused with your script tags. Change this: <script> to this: <script rel="javascript" type="text/javascript"> You do not need to specify the type if you are using a browser capable of HTML5.

Categories : Jquery

how to add tabs Dynamically with dynamic content.?
$('#tabs a.tab').live('click', function() { // Get the tab name var contentname = $(this).attr("id") + "_content"; // hide all other tabs $("#content p").hide(); $("#tabs li").removeClass("current"); // show current tab $("#" + contentname).show(); $(this).parent().addClass("current"); }); $('#tabs a.remove').live('click', function() { // Get the tab name var tabid = $(this).parent().find(".tab").attr("id"); // remove tab and related content var contentname = tabid + "_content"; $("#" + contentname).remove(); $(this).parent().remove(); }); this codes using a live() method, live method was changed in new jquery versions. you can use on() method like this. $('body').on('click','#tabs a.tab' function() { // Get the tab name var contentname = $(this).attr("i

Categories : Jquery

How to copy content from a dynamic page using PHP?
Use cURL to get the page content and then parse it - extract the <pre> section. $ch = curl_init(); // Set query data here with the URL curl_setopt($ch, CURLOPT_URL, 'val=24655740&db=nuccore&dopt=fasta&extrafeat=0&fmt_mask=0&maxplex=1&sendto=t&withmarkup=on&log$=seqview&maxdownloadsize=1000000'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, '3'); $content = trim(curl_exec($ch)); curl_close($ch); // show ALL the content print $content; $start_index = strpos($content, '<pre>')+5; $end_index = strpos($content, '</pre>'); $your_text = substr($content, $start_index, $end_index-$start_index); UPDATE Using the link from @ovitinho's answer - it now works :)

Categories : PHP

FB.Canvas.setSize and dynamic content?
Yes there is, the only drawback is that on your app settings you must specify a fixed height of 800px and then use: FB.Canvas.setAutoGrow() Here's more info: https://developers.facebook.com/docs/reference/javascript/FB.Canvas.setAutoGrow/ But if you know when your content is going to change you should use FB.Canvas.setSize() https://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/

Categories : Facebook

How to change the html of a div and add dynamic content to it
a.) Why dont you just store the #twit.attr before you replace the div and then assign the value after replacement. //Make a copy of all attributes of #twit //TODO Replace #twit //TODO set all attributes to the new #twit b.) Another option is to stop replacing #twitter completely and instead re-using it (including its children). Might be less resource consuming.

Categories : Javascript

Masonry not working with dynamic content
You should use appended method. From docs: Add and lay out newly appended item elements. Look at this jsfiddle Try to change your code to boxHtml += tagsHtml + '</div>' + descriptionHtml + '</div>'; var $boxHtml = $(boxHtml); $content.append($boxHtml).masonry('appended', $boxHtml);

Categories : Javascript

dynamic page content with primefaces
Try surrounding the calendars with a: <p:outputPanel id="someId" > ... </p:outputPanel> Primefaces - Output Panel

Categories : Java

Dynamic Navigation Sidebar Content
You should use simple PHP. Create a file called nav.php, for example. Put in it your menu. Then, to call this file from any other location, simply put this: <?php include('nav.php'); ?> Then, if you want to change given link on every site, you just need to modify it once in nav.php file. P.S - all of your files must have .php extension, otherwise it won't work.

Categories : Javascript

Dynamic Content Swap via AJAX
for example use jquery. first add jquery to your html. within the domready-event you can register click events on your ribbon-menue. on each click you load the div-content from the given link-url in the html-part. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $.ready(function(){ $(".ribbon-content a").on("click", function(event){ event.preventDefault(); $(".con").load($(event.target).attr("href"), function(){ // add code after loading - for example change classes of menue }) }); }) </script> additionly you can the the browser-history to enable the prev- and next-buttons of the browser.

Categories : Javascript

Dynamic content in custom mobiscroll
The following code should work for you: var friendlist = {} $.each(data, function (i, val) { $.extend(friendist, {"1":"<div class='friend'><div class='profileimg'><img src='http://mypage.com/"+val.img+"'/></div><span>"+val.name+"</span></div>'"}); }); // here friendlist will be of the format you expect

Categories : Javascript

How to get dynamic html-table-content
Here you have a solution with JQUERY. Try if yourself In this example we show in an alert dialog the content of the description number 3. HTML: <table id="mytable"> <tr> <td> Description 1 </td> <td> Content 1 </td> </tr> <tr> <td> Description 2 </td> <td> Content 2 </td> </tr> <tr> <td> Description 3 </td> <td> Content 3 </td> </tr> </table> JQUERY: // Search content of description number 3 $(document).ready(extractContent(3)); function extractContent(num) { $('td', $('#mytable')).each(function() { // The text in the first column must match " Description num " if ($(this).text() == " Description

Categories : PHP

Bootstrap span4 dynamic content
try This <div class="row-fluid"> <div class="span12"> <h2>TITLE</h2> <p>DESCRIPTION</p> </div> </div> <div class="row"> <!-- what should be dynamic --> <div class="span4"> <h2>TITLE</h2> <p>DESCRIPTION</p> <p><a href="#" class="btn">BUTTON</a></p> </div> <div class="span4"> <h2>TITLE</h2> <p>DESCRIPTION</p> <p><a href="#" class="btn">BUTTON</a></p> </div>

Categories : CSS

jquery modal with dynamic content
You can check and retrieve the id with jquery at the start of the page like this: var url = window.location.pathname; var id = url.substring(url.lastIndexOf('/') + 1); or with PHP / jQuery: var id = '<?php if(isset($_GET['id']))echo($_GET['id']; ?>';

Categories : Jquery

web scraping dynamic content with python
A very similar question was asked earlier here. Quoted is selenium, originally a testing environment for web-apps. I usually use Chrome's Developer Mode, which IMHO already gives even more details than Firefox.

Categories : Python

adding dynamic content using javascript DOM
I think you need to clone the div with id fdetails_edu_div Use the following code var x = 1; function add() { var container = document.getElementById('education'); var detail = document.getElementById('fdetails_edu_div'); var clone = detail.cloneNode(true); clone.id = "fdetails_edu_div" + x; x++; container.appendChild(clone); } Notice, I create a new id for the newly created div. Also note, I have removed the Add button from within the div fdetails_edu_div and placed it outside (you don't want the add button to repeat, do you?) See working fiddle

Categories : Javascript

How do I take dynamic content created using geolocation and use it in another div?
Define the variable userLatLng outside the geolocationSuccess() function otherwise it is only accessible inside the function. At the same time you can assign the value of that variable to a hidden input and send it through email. Swap the order of these: function geolocationSuccess(position) { var userLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); For this: var userLatLng; function geolocationSuccess(position) { userLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); Major edit: I am able to access the content by adding this just before the body tag is closed: <script> $("#the_trigger").click(function(){ alert($("#address").html()); }); </script> And adding an ID of "the_trigger" to t

Categories : Javascript

loading dynamic content with AJAX
Smart Wizard documentation : When a step got focus, the SmartWizard will post the step number to this contentURL and so you can write server side logic to format the content with the step number to be shown next. The response to this call should bethe content of that stepin HTML format. So, I suppose you musn't send the element with the tag, but only the content.

Categories : Jquery

div doesnt grow with dynamic content
$('input[type=button]').click(function () { p = p + 75; i++; var newdiv = document.createElement('div'); newdiv.setAttribute('id', 'draggable' + i); newdiv.style.position = "absolute"; newdiv.style.top = +p + "px"; newdiv.style.left = "20px"; newdiv.style.border = '1px solid #000'; newdiv.style.display = 'inline-block'; newdiv.style.width = '75px'; newdiv.style.height = '75px'; newdiv.innerHTML = "draggable inner div"; document.getElementById("content").appendChild(newdiv); var g = $('#draggable' + i); var o = $('#content'); o.height(o.height() + 30); //new code g.draggable({ constraint: "#content", drag: function (event, ui) { if (g.position().top > o.height() - g.height()) {

Categories : Javascript

Translating Dynamic Content in Wordpress
Recently I have been using Polylang Plugin for WordPress. It gives you plain control over the website translation, from content to menus and strings translations. Best of all: most of your work will be done through WP Admin interface instead of php code.

Categories : PHP

Dynamic css - wrong content type
The problem seems to be in the requested url. <%= get_css_path %> will return /get_css and hence the controller action with handle this request by the format.html part. So you can try to append the format with the url as: <link href="<%= get_css_path(:format => :css) %>" media="screen" rel="stylesheet" type="text/css" /> This will request /get_css.css and hence the action will handle with format.css part.

Categories : CSS

validating dynamic text box content in PHP
did you mean something like this? <?php if(isset($_POST['sendtwo'])) { echo "Hello"; } ?> <form method='post' action=''> <?php if (!isset($_POST['sendone'])) { ?> <input type="submit" name="sendone" id="sendone" value="OneClick"> <? } else { ?> <input type="hidden" name="sendone" id="sendone" value="OneClick"> <input type='text' name='txt1' id='txt1'<?=isset($_POST['txt1']) && trim($_POST['txt1']) !== '' ? ' value="'.trim($_POST['txt1']).'"' : ''?>> <input type='submit' name='sendtwo' id='sendtwo' value='TwoClick'> <? } ?> </form> <?php if (isset($_POST['sendtwo'])) { if

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.