w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to detect a browser supports requestFullscreen
When you put if (docElm.requestFullscreen), you are detecting if the browser supports that method because it will return true if requestFullscreen is defined on the docElmobject.

Categories : Jquery

Does requestFullScreen() only work for width and relative position?
Is it possible to fullscreen according to the height of an element? No, the full-screen mode does not care about the proportion of the element it initiates from - it will use the screen dimensions as target. You will need to handle this in code by padding the edges. Another problem is that fullscreen does not seem to support absolute positioned elements. The specifications doesn't say anything about this as far as I could see just browsing over it. However, the full-screen mode has currently an experimental status in most major browsers and the behavior can vary from browser to browser as well as being unstable and prone to bugs. From Mozilla Developer Network: It's worth noting a key difference here between the Gecko and WebKit implementations at this time: Gecko automa

Categories : Javascript

Sequence contains no elements for Query with Multiple Elements Possible
If the sequence is empty and you iterate over it, nothing should happen, which is the semantic you usually want (and what you're looking for as well). What exactly is the iteration code you're using? A foreach shouldn't have any problems with an empty sequence.

Categories : C#

How to send files and data from form with multiple divs and multiple dynamic elements as shown below?
Maybe this way will be better $(document).ready(function() { // submitting $('#upload-form').on('submit', function() { // get values var answer = $("#album_name").val(); // if empty if(answer == '') { alert('write album name'); } else { // ajax $.ajax({ url: $(this).attr('action'), // path for submit (upload.php) type: $(this).attr('method'), // here is post data: $(this).serialize(), // put all values into $_POST success: function(html) { // I get answer from upload.php alert(html); } }); } return false; // for not submitting the form }); });

Categories : PHP

Create Multiple Lightboxs for Multiple Elements on Single Page?
You could for example specify which lightbox id the a should have by storing it in data <a href='#' data-light='1'>Lightbox 1</a> <a href='#' data-light='2'>Lightbox 2</a> <a href='#' data-light='3'>Lightbox 3</a> The you get data in your script jQuery('a').click(function(){ jQuery('#unique-lightbox-' + $(this).data('light')).fadeIn('1000'); return false; }); Or if you have all your a in one parent. You could use their index jQuery('a').click(function(){ jQuery('.lightbox:eq('+($(this).index()+1)+')').fadeIn('1000'); return false; });

Categories : Javascript

Jquery multiple animations multiple elements one onclick function
you need to disable the queue for the animations that shall run at the same time: $('#effect1').click(function() { $(this).finish(); $(this).animate({ right: 200, queue : false }); $('#effect2, #effect3').animate({ left: 1000, queue : false }); }); From the jQuery API Docs: queue (default: true) Type: Boolean or String A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. [Edit] try this: $('#effect1').click(function() { $(this).finish(); var self = this; setTimeout(function(){ $(self).animate({ right: 200, queue : false }) },1); setTimeout(function(){ $('#effect2, #effect3').animate({ left: 1000, queue : false }); },1); });

Categories : Jquery

Knockout.js: Toggling Visibility Of Multiple Dom Elements Using Multiple Buttons
You could create a viewModel that contains the id of div to show. This property will be set accordingly of the button on which you click. View model: $(document).ready(function () { var ViewModel = function(){ var self = this; self.onClick =function(data, event) { var element = event.target.id.replace('button', 'text'); self.shownElement(element) }; self.shownElement =ko.observable(null); }; ko.applyBindings(new ViewModel()); }); View : <div id="text1" class="text" data-bind="visible: shownElement() == 'text1'">Text 1</div> <div id="text2" class="text" data-bind="visible: shownElement() == 'text2'">Text 2</div> <div id="text3" class="text" data-bind="visible: shownElement() == 'text3'">T

Categories : Javascript

JQuery: Bind multiple triggers from multiple elements to one event
You can check if an animation is currently running by using: function toggleSearch() { if (!$("#search").is(":animated")) { $("#search").animate({ width: "toggle", opacity: "toggle" }, "slow",function() { $(this).focus(); }); } } $("#searchButton").parent('li').siblings().animate({ width: "toggle", opacity: "toggle" }, "slow"); $("#searchButton").click(toggleSearch); $("#search").blur(toggleSearch); http://jsfiddle.net/hGgc9/3/

Categories : Jquery

How can I bind multiple elements to multiple events in jQuery?
Try this. $(document).on('click submit', '#regForm, .regDiv', function(e) { //place your code }); .on() should be like .on( events [, selector ] [, data ], handler(eventObject) )

Categories : Javascript

AngularJS directive - setting order for multiple directive elements (not priority for directives, but priority for the elements)
OK, here's my solution, although it's more a template. Fiddle (check the console log to see the result) I've wrapped the foo directive in a fooParent directive, like so: <div foo-parent> <div foo run="3"></div> <div foo run="1"></div> <div foo run="2"></div> </div> The fooParent directive exists pretty much to do three things: Expose a function to foo items so they can be added to a general list Maintain a list of foos, which will be sorted during post-linking Process each foo in the run order specified. It looks like this: app.directive('fooParent', function() { var foos = []; return { restrict: 'A', controller: ['$scope', '$element', '$attrs', '$transclude', function($scope, $element, $attrs, $t

Categories : Javascript

Centre multiple elements within div using css
I don't think you can achieve this only with CSS, without hardcoding values. You can use flexbox http://coding.smashingmagazine.com/2013/05/22/centering-elements-with-flexbox/ (not so good browser support) or a JavaScript solution. EDIT: I'm using jQuery. for three circles: var rowWidth = jQuery('.row').width(); var circleWidth = jQuery('.circle').width(); var equalSpace = rowWidth - (3*circleWidth); jQ('.row').css("padding-left", equalSpace + "px").css("padding-right", equalSpace + "px"); for a dynamic number of circles: var rowWidth = jQuery('.row').width(); var circleWidth = jQuery('.circle').width(); jQuery('.row').each(function(){ var circNumber = jQuery(this).children('.row').length; //this will give you the number of circles inside the current row. var thisWidth =

Categories : HTML

Is it allowed to have multiple elements with same name in XSD?
If you are not sure about a xml structure, you should validate it try one of this sites: http://validator.w3.org/ http://www.validome.org/xml/ I'm not absolutly sure about your question, but in general you can use multiple xsd documents. You just need to be sure that you define in the upper node that multiple namespaces are allowed.

Categories : Xml

How to put multiple JS elements into one group
this is what classes are for document.getElementsByClass('class_name').addEventListener("mouseover", function(event){ event.target.src = "ring.png" }, false); with html: <img class="class_name"/>

Categories : Javascript

Using the same directive on multiple elements
You need to give your directive an isolated scope. Right now, multiple instances of the directive are sharing the same scope, so updating your model is not working as expected. Take a look at docs.angularjs.org/guide/directive require: '^ngModel', restrict: 'A', scope: { ... }, link: function (scope, elm, attrs, ctrl) { ....

Categories : Angularjs

Set ko.observable value from multiple DOM elements
The view is the wrong place to store data. It's also not very flexible. What if your picker questions stored their own options? That would not only allow each question to have different options, but a different number of options. It also keeps data of of the view, and simplifies your HTML and viewmodel code, and keeps the DOM access out of the viewmodel without requiring a custom binding (not that you should avoid custom bindings at all costs, I just don't think this is a good case for them). A picker question }, { text: "dependent on master question", answer: null, controlType: "picker", pickers: [ { name: "Size", options: ['Large', 'Medium', 'Small'], value: '' }, { name: "Color", options: ['Red', 'Blue', 'Green'], value: '' } ] } View <script

Categories : Knockout Js

how to get multiple xml-elements without using xmlaggregation
Assuming all the data comes from a single table (or view) called dataview ... I think you are going to need to use XMLForest in there. For example, Create or Replace VIEW dataviewxml as Select XMLElement("NieuweSurveys", XMLForest(d.Surveynaam as Surveynaam, d.Startdatum as Startdatum, d.Eindatum as Eindatum, XMLForest(d.Voornaam as Voornaam, d.Tussenvoegsel as Tussenvoegsel ) as "Deelnemer" ) as "Survey" ) as "Result" from dataview d;

Categories : Xml

ZeroClipboard - Using multiple elements
Give a common class to all these elements, and then make all of them available to ZeroClipBoard : < a id="c101" class="toBeCopied" href="something"> < a id="c102" class="toBeCopied" href="something else"> Then load them like this : var clip = new ZeroClipboard($(".toBeCopied"));

Categories : Misc

ArrayDeque add multiple elements
You can simple create the new item in the call of add: items.add(new Item("CoffeTable", "brown")); So you don't need an explicit variable. Also note that in Java variable names normally start with a lower case character.

Categories : Java

Group by on multiple elements with XSL
Just apply a sorted query and output those that are unique: <xsl:variable name="states"> <xsl:value-of select="//state/*[contains(name(), 'current next')]/text()"/> </xsl:variable> <xsl:for-each select="str:tokenize($states)"> <xsl:sort select="text()"/> <xsl:if test="preceding-sibling::*/text() != text()"> <xsl:element name="state"><xsl:value-of select="text()"/></xsl:element> </xsl:if> </xsl:for-each> Here is an update that includes an example using exsl node-set, for xslt implementations that do not support tokenize: <xsl:variable name="states"> <xsl:for-each select="//state/*[contains(name(), 'current next')]"> <xsl:element name="state"> <xsl:value-of sele

Categories : Xml

Finding multiple elements
In case someone looks for this in the future, I got it to work: findElements(By.className("someclass")).then(function(elements_arr){ console.log(elements_arr.length); }); According to their source code, findElements returns a promise https://code.google.com/p/selenium/source/browse/javascript/webdriver/webdriver.js#803

Categories : Javascript

X and Y Positions of multiple jQuery UI Elements
First of all, Double ID's are not good.. box-1 and box-2 are better: You are matching all elements with class '.posX' etc. Try this: $(document).ready(function() { var a = 3; $('.dragThis').draggable( { start: function(){ $(this).css("z-index", a++); }, drag: function(){ var offset = $(this).offset(); var xPos = offset.left; var yPos = offset.top; $(this).find('.posX').text('x: ' + xPos); $(this).find('.posY').text('y: ' + yPos); } }); $('.dragThis').click(function(){ $(this).addClass('top').removeClass('bottom'); $(this).siblings().removeClass('top').addClass('bottom'); $(this).css("z-index", a++); }); });

Categories : Jquery

PHP multiple conditional elements within "SELECT * FROM
MySQL supports IF() conditionals out of the box. Just make sure you get your syntax right as it's slightly different from a PHP if(). http://dev.mysql.com/doc/refman/5.0/en/if.html also this http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html

Categories : PHP

Single .on click for multiple elements
Simply don't use the delegation feature, instead do your own checking: $(".parentElem").on("click", function() { // check if event.target matches an element that you want to trigger on });

Categories : Javascript

How can I retrieve multiple elements from an XML file
select partitionKey, title; does not do what you think it does. It looks like you want to return instances of an anonymous type with two properties: partitionKey and title. To do this, you must declare the anonymous type explicitly, i.e. select new { partitionKey, title }; As to what your line of code actually does, based on the compiler error text, I think that it is simply illegal syntax. NB: The VB.NET compiler is a bit more forgiving. It does treat Select partitionKey, title as syntactic sugar for Select New With { partitionKey, title }, which is what you would expect.

Categories : C#

How do I use jQuery slideToggle on multiple elements?
There are multiple problems in your code this is a object reference not a string .drawer is a next().next() sibling of the clicked .call elements parent .tile you have to use $('.call').click(function() { $(this).closest('.tile').next().next('.drawer').slideToggle('slow', function() { }); }); Demo: Fiddle

Categories : Javascript

Applying same style to multiple elements
You could use FrameworkElement as a TargetType: <Style TargetType="FrameworkElement" x:Key="CommonStyle"> <Setter Property="Control.Background"> <Setter.Value> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" > <GradientStop Color="#FFFFD190" Offset="0.2"/> <GradientStop Color="Orange" Offset="0.85"/> <GradientStop Color="#FFFFD190" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> </Style> And then use specific styles for each element by inheriting (BasedOn) CommonStyle: <Style TergetType="TextBox" BasedOn="{StaticResource CommonStyle}" x:Key="TextBoxStyle"> <Setter Property="Margin" Value="2"/&g

Categories : Wpf

Parsing multiple elements with Mechanize
You can use: page.search('meta[@name="DC.creator"]')[1][:content] at is equivalent to search(...).first so using the same selector with search and grabbing the second element found will work as long as there are truly two tags that match. If not, you'll get an exception because you can't take the index of a nil value. And, as a FYI, Mechanize uses Nokogiri internally to handle its HTML parsing and manipulation. Nokogiri supports both CSS and XPath selectors so you can use whichever makes it easier for you to find the tag or element you want. I lean toward CSS for readability, but use both. See the Nokogiri tutorials for more information about searching. require 'nokogiri' doc = Nokogiri::HTML(<<EOT) <meta name='DC.creator' scheme='inventor' content='Chen Yonghong' /> <

Categories : Ruby

How to use a variable for toggling multiple elements
Try this - $("#main > .item").click( function () { if ($.trim($(this).next('.text').text()) == "") { var currentext = $(this).data("text"); $(this).next('.text').text(currentext); } else { $(this).next('.text').text(""); } }); Demo ---> http://jsfiddle.net/ws3FQ/5/

Categories : Jquery

How to remove event from multiple elements
Well, one reason might be that your loop never runs. You need to initialize i in your loop: for(var i = 0; i < inputs.length; i++){ var input = inputs[i]; input.removeEventListener('onmouseup'); } Otherwise this loop will never run due to i having the initial value of undefined. Your call to removeEventListener also won't work as expected. You will also need to provide a reference to the listener/handler that you used. See here for the proper usage of removeEventListener. If everything is using mouseUpFun, you can provide that to removeEventListener: input.removeEventListener('onmouseup', mouseUpFun);

Categories : Javascript

jquery insertbefore for multiple elements
You can use prependTo $(document).ready(function () { $('li').each(function () { var $this = $(this); $('p.ui-li-aside', $this).prependTo($this); }); }); Check Fiddle

Categories : Jquery

How to get index of name attribute from same name of multiple elements.
This will return the indexes in an array: var indexes = $('[name^="op_price"]').map(function(){ return this.name.match(/d+/); }).get(); console.log(indexes); // ["20", "2", "14"]

Categories : Javascript

Javascript fade in multiple elements
Use your brandy dandy .fadeQueue(): working jsFiddle $.fn.fadeQueue = function(){ $(this).fadeIn(function(){ if(!$(this).is(':last-child')) // making sure we are not done $(this).next().fadeQueue(); }); } This will wait for the callback of .fadeIn() for each div before moving to the next one..

Categories : Javascript

C++, How to replace multiple elements in an array
you may want to check out std::rotate (first, middle, end); So you code will be something like std::rotate(A, A+1, A+3); The link is http://en.cppreference.com/w/cpp/algorithm/rotate

Categories : Arrays

.addClass for multiple label elements
$('label').addClass('error'); Just use the element selector If you only want to add them to the labels associated with the fields then you can try this var fieldInError = '#phone,#email'; $(fieldInError).each(function() { var $this = $(this); $this.addClass('error'); $('label[for="' + $this.attr('name') + '").addClass('error'); });

Categories : Jquery

Select multiple elements with similar ID
No, but this is possible: $('#thistext0, #thistext1, #thistext2, #thistext3').keyup(function(e){ var keyed = $(this).val(); $("#target").html(keyed); }); Of course, the selector string can be created in a loop. Or just add a class to your input fields, and select by class.

Categories : Jquery

How to get multiple elements with same name in a node with XDocument?
The below mentioned code should work out. I have considered list as an object of List var datas = from query in loadedData.Descendants("news") select new News { Title = (string)query.Element("title"), Id = (string)query.Element("id"), StrDate = (string)query.Element("date"), list = (from xele in query.Descendants("machine") select xele.Value).ToList<string>(); };

Categories : C#

Get one element to scroll for multiple elements
You can do exactly what you proposed... $('#Index3').on('scroll', function() { $('.group').scrollTop($(this).scrollTop()); });

Categories : Javascript

Pulling multiple elements from dataframe R
This will give you each team as a separate dataframe in a list: split(df, df$team) It sounds like your id and name variables do not vary (i.e., that id and name are basically identical). In that case, to find the most common id or name, just use table (possibly sort-ed): sort(table(df$id), decreasing=TRUE) sort(table(df$name), decreasing=TRUE) You might also want something like to combine the two: sort(with(df, table(paste(id,name))),decreasing=TRUE)

Categories : R

Qtip2 Use same tooltip on multiple elements
You can add an event to the options like this: [... all the other options], events: { hide: function(event, api) { $('input.abc').val($(this).find('input').val()); //This will sync all the inputs upon exiting tooltip //$(this).find('input').val(""); //This will blank out the input upon exiting } } Please note that I've included both of the requirements above just use one of them

Categories : Jquery

Fade In / Out Multiple Elements Using jQuery.when
You can exploit a feature of jQuery by which an animated jQuery collection will return a "promise of completion" with .promise() : I think this is what you are trying to achieve : $('.next-' + id).fadeOut(500).promise().then(function() { var n = ...; return $('.next-' + n).fadeIn(500).promise(); }).then(function() { ... }); Note that by building a .then() chain in this way, we avoid a "pyramid of doom". Things get a bit trickier if you are using an custom animation queue, but for the standard fx queue (as in this case), everything is made very simple for you.

Categories : Jquery



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