w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Width on hover acting funny?
I can't tell you the exact problem, because I think your navigation should not work at all. But your problem is with the % width of the li elements in the current/hover state. The percent width has the meaning the given percentage of the parents width is used of the element. Because the ul is growing for certain elements in its width, the current element also growth in its width. Why the hover works with percentage in the initial stage is not clear to me right now, I would need to look closer at it. But hopefully this information already helps you.

Categories : Jquery

express view cache acting funny
Edit: Notice that express sets view cache enabled for production: see express docs view cache Enables view template compilation caching, enabled in production by default Try adding this line in your app config section: app.disable('view cache'); Also, try adding cache-control headers res.setHeader('Cache-Control', 'no-cache'); res.render('articles/show', { ... From w3.org docs: Cahce-Control The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. The directives specify behavior intended to prevent caches from adversely interfering with the request or response. These directives typically override the default caching algorithms. Cache directives are unidirectiona

Categories : Node Js

My navigation is acting kind of funny: setting a width won't work and it jumps
Add this to your CSS: #leftcolumn a {float:right} You'll notice that when you mouseover each item and back again, you get the animations queuing up. If you don't want this; Change $(this).animate to $(this).stop().animate Fixes: With CSS fix : http://jsfiddle.net/nv78t/2/ With CSS fix and jQuery fix : http://jsfiddle.net/nv78t/3/

Categories : Jquery

JQuery fading in fading out continuously
Simply remove the while loop and it works perfectly $(document).ready(function () { $("#Imag1").fadeOut(3000); $("#Imag2").fadeOut(8000); $("#Imag3").fadeOut(6000); $("#Imag1").fadeIn(2000); $("#Imag2").fadeIn(5000); $("#Imag3").fadeIn(9000); }); Working jsFiddle EDIT Since you want it endless, you can put the effects into another function and run it on the callback. Updated fiddle here $(document).ready(function () { fadeThem(); }); function fadeThem() { $("#Imag1").fadeOut(3000, function() { $(this).fadeIn(2000, fadeThem()); // Apply the callback to the one with the shortest combined animation time }); $("#Imag2").fadeOut(8000, function() { $(this).fadeIn(5000); }); $("#Imag3").fadeOut(6000, function() {

Categories : Javascript

sliding UI panels on iOS but where it slides out of another panel (i.e. not where the main window is frozen and slides out)
There are a bunch of libraries that people have written to accomplish something like this. I recently used ECSidingViewController, but a quick search found JASidePanels, PKRevealController, and MFSideMenu. All implement a sliding side menu, and while i'm not sure what you're describing with the "second panel with more buttons" these solutions could likely be nested to achieve that. JASidePanel appears to haveh built in stuff for that as well.

Categories : IOS

Fading with jquery
firstofall you don't need two document.ready function there.remove one..and for effect you can use fadeIn or slideDown or animation() try this (using fadeIn) <script type="text/javascript"> jQuery(document).ready(function($) { words = ['ASS-KICKING','MIND-BLOWING','AWESOME','SWEET']; setInterval(function() { var thisWord = words[Math.floor(Math.random() * words.length)]; $("#container").hide().text(thisWord).fadeIn('slow'); },3000); }); </script>

Categories : Jquery

Jquery Why is my div fading in and out and in again?
It's because when you click the link to go back to the top of the page, it triggers the scroll event as well. One solution would be to set a flag when you click the link, like this: var showBackToTop = true; $(window).scroll(function () { if ($(window).scrollTop() > $(this).height() + 100 && showBackToTop) { $('.backToTop').fadeIn(); } else { $('.backToTop').fadeOut(); } }); $('.backToTop a').click(function () { showBackToTop = false; var anchor = $(this).attr('href'); var sub = anchor.substring(anchor.search('#')); $('html, body').animate({ scrollTop: 0 }, 800, 'swing', function(){showBackToTop = true;}); });

Categories : Jquery

jquery fading between to blockquotes
$(document).ready(function() { $('#firstQuote').fadeTo(200, 0.8); setInterval(function(){ $('blockquote').filter(':visible').fadeOut(1000,function(){ if($(this).next('blockquote').size()){ $(this).next().fadeTo(1000, 0.8); } else{ $('blockquote').eq(0).fadeTo(1000, 0.8); } }); },10000); });

Categories : Jquery

jQuery not fading on hover
Just use CSS td { opacity: .85; transition: opacity .25s ease-in-out; -moz-transition: opacity .25s ease-in-out; -webkit-transition: opacity .25s ease-in-out; } td:hover { opacity: .5; } Demo: http://jsfiddle.net/maniator/bnrWK/

Categories : Javascript

Jquery toggle('slide') only slides once
When you use toggle on hover, you don't need to do the the mouseleave event. Also note that stop takes to boolean parameters, first for clear queue, second for jump to end: Just do: $('.proimg').hover(function(event) { $('.boxcaption',this).stop(true, true).toggle( 'slide' ); }); Fiddle: http://jsfiddle.net/rK4GD/10/ See: http://api.jquery.com/stop/

Categories : Javascript

jQuery: when slider form slides down its sliding from the top
One of the ways to solve it. #like form { position:relative; top:50px; display:none; width:180px; background:#ebece7; padding:20px; border:1px solid blue; height:150px; } jsfiddle

Categories : Jquery

Slides using jquery cycle won't load correctly
Please correct your javascript and try. Last attribute of any json shouldn't be followed by comma(,). Please remove the comma after height attribute value & try if it works. <script type="text/javascript"> function pageLoad(){ $('#myslides').cycle({ slideResize: 1, containerResize: 1, fit: 1, width: '1138px', height: '532px' }); } </script> I think you have set options to true or false, but at http://jquery.malsup.com/cycle/options.html options are set to 1 or 0. Please refer jQuery Cycle Plugin - Option Reference for more details.

Categories : Jquery

jQuery - Sidebar that slides in, and keep the window width
Create a button that will toggle the menu: var menuEnabled = false; $("button").click(function() { if (menuEnabled) { $("#left").css("display", "none"); $("#content").css("margin-left", "0"); menuEnabled = false; } else { $("#left").css("display", "block"); $("#content").css("margin-left", "200px"); menuEnabled = true; } }); Full Demo here: http://jsfiddle.net/YwRSb/4/

Categories : Jquery

Jquery not acting as expected
So this was the issue : I had #addother and #onlyother both set to if it is checked then open #counselorcomments so when one was checked (the #Onlyother) #addother was forcing the #counselorcomments box to to remain closed. what I did was create another text area : <textarea name="counselorcomments" rows="5" cols="40" id="emailcomments" placeholder="Emailed Counselor Comments"><?php echo set_value('counselorcomments') ?></textarea> <textarea name="counselorcomments" rows="5" cols="40" id="counselorcomments" placeholder="Counselor Comments"><?php echo set_value('counselorcomments') ?></textarea>

Categories : Jquery

How do I make this JQuery slider render slides properly?
In order to resolve the first issue what you can do is: put all the image div elements in a parent container element, as in <div id="container"> <div id="slide1">Slide 1 content</div> <div id="slide2" style="display:none">... </div> then you should apply CSS to parent container which will help you lay the given elements in proper inline manner and will form a long chain of images instead of showing one at a time. Note: fix the width, height according to the image content, and set overflow to hidden so that rest of the images don't show up. next all you have to do is use the jQuery's .animate() method on click of your images (left & right) and shift the current div of [.active] div approporiately eg. ... $('.active').animate({

Categories : Javascript

jquery carousel how to have a gradient on start and ending slides
CSS3 solution - http://jsfiddle.net/UddqU/ Gradient CSS generated from - http://www.colorzilla.com/gradient-editor/ HTML <div id="wrapper"> <div id="left"></div> <div id="right"></div> </div> CSS: body {background:orange;} #left {float:left; width:25%; height:400px; background: -moz-linear-gradient(left, rgba(230,240,163,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(230,240,163,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(left, rgba(230,240,163,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(left, rgba(230,240,163,1) 0%,rgba(255,255,255,0) 100%)

Categories : Jquery

Change the speed or timeout of jQuery Cycle slides
You have the option timeout por the cycle... You already try? timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)

Categories : Jquery

list navigation that slides open to left to open, slides right to close
You can use animation and margin to slide in from right to left. .drop-down-nav { float: left; width: 640px; height: 159px; background-color:grey; padding: 1px 0; opacity:0; margin-left:600px; clear: both; } jquery: var $itemContent = $('.drop-down-nav'); $('.drop-down-btn-up, .drop-down-btn').click(function(e){ e.preventDefault(); if($itemContent.css('margin-left') == "600px"){ $('.drop-down-nav').animate({ marginLeft: '0px', opacity:1 }) } else { $('.drop-down-nav').animate({ marginLeft: '600px', opacity:0 }); } }); http://jsfiddle.net/QmEcs/8/

Categories : Jquery

jquery/rails exception for fading out flash message
You can use jQuery's not method http://api.jquery.com/not/. //fadeout flash messages $('.flash').not('.login_error').fadeIn(function() { setTimeout(function() { $('.flash').fadeOut(); }, '2000'); });

Categories : Jquery

jQuery menu acting strangely
I replaced $(this).position().top + 200 with the preferred method +=200px for .animate(). Fiddle: http://jsfiddle.net/LLdjh/10/ Since #panel starts with top: 0px, you can use static values for the .animate() instead. Fiddle: http://jsfiddle.net/LLdjh/11/ jQuery: $(function () { var gomenu = "open" $(".slidebtn").click(function () { if (gomenu == "open") { $("#panel").stop().animate({ top: "200px" }, 500); gomenu = "close"; } else if (gomenu == "close") { $("#panel").stop().animate({ top: "0px" }, 500); gomenu = "open"; } }); });

Categories : Jquery

.prev() not acting according to jQuery api documentation?
You are using .prev().find('.static-sublayers') which will search for .static-sublayers in div with class static-sublayers. Try using this: copy.appendTo(jQuery(el).prev()); DEMO FIDDLE

Categories : Jquery

Move Pagination outside of slides-container wrapper in jquery SuperSlides
You should just output the custom pagination HTML yourself like this: <nav class="slides-pagination"> <a class="current" href="#1">1</a> <a href="#2">2</a> <a href="#3">3</a> </nav> Then disable the auto pagination feature: $('#slides').superslides({ pagination: false }); And since they attach the .current class only to the autogenerated menu, you need to replicate this function using the animated.slides event like this: $('#slides').superslides({ pagination: false }).on('animated.slides', function() { var current_index = $(this).superslides('current'); $('.slides-pagination a').removeClass('current'); $('.slides-pagination a').eq(current_index).addClass('current'); });

Categories : Jquery

Can anyone provide a simple fading slideshow jquery script for a noob?
Try "pre-loading" the images first, for more immediate image manipulation: // this variable is used in both code-snippets: var images = $("img"); function preload(arrayOfImages) { $(arrayOfImages).each(function () { $("<img/>")[0].src = this; }); } preload($("img")); ...and then you could transition the images with javascript's setTimeout and jQuery's fadeIn() and fadeOut() : var currentIndex = images.length; var delay = 4000; (function transitionImages() { // fading the current image out: images.eq(currentIndex).fadeOut(delay); var previousIndex = currentIndex; while (currentIndex == previousIndex) { // setting a new unique index here: currentIndex = Math.floor(Math.random() * images.length); } // fading the next ima

Categories : Jquery

I need to make a object to float left while fading out inside a div using jquery
As you tagged jquery ,Use Animate() $("yourDivId").hover(function(){ $('#sliding_image').animate({ 'padding-left': '+=100px' }, "normal"); }, function(){ $('#sliding_image').animate({ 'padding-left': '-=100px' }, "normal"); }); http://api.jquery.com/animate/

Categories : Javascript

Pseudo-selectors acting strangely with jQuery
Since you are trying to target an object in jQuery you can't get the first letter that way. You are working with an object, not a string. The first example is targeting all odd objects, but the second one is targeting the object string (a.k.a the first letter). So you should split your code a little, first to take the object text and then to take it's first letter.

Categories : Jquery

Jquery focus/submit acting weird in Chrome-Browser
Well, that is because, when you try to click the button, it focuses out and the focusout event is fired and button is hidden. to resolve this you can do this. $("#helpkontakt textarea, input, select, #submit").focusout(function() { setTimeout(function(){ $("#helpkontakt").css("height", "200px"); } ,100); }); Demo

Categories : Javascript

jQuery toggle slides DIV up and down, but UL content animates left to right. How can I make the content slide up and down?
toggle() simply toggles the showing/hiding, but doesn't specify how to show/hide. Try: $('#myMenu ul').slideToggle('slow'); jsfiddle

Categories : Jquery

Bootstrap carousel: changing jquery slides to bootstrap caroulsel and binding a slide function
found a solution.This one gets the current index of the carousel $('#myCarousel').bind('slid',function(e){ var current = $(".active", e.target).index()+1; $('#activeSlideIndex').val(current); $('#popLightbox div.rating a').attr('rel', imageIdArray[current-1] +';media'); $('#popLightbox a.voteNegative').html('<img src="{$liveSite}/templates/{$theme}/desktop_images/images/unlike.png" align="absmiddle"><b class="sprite">&nbsp;</b> ' + voteCountArray[current-1][0]); $('#popLightbox a.votePlus').html('<img src="{$liveSite}/templates/{$theme}/desktop_images/images/approve.png" align="absmiddle"><b class="sprite">&nbsp;</b> ' + voteCountArray[current-1][1]); });

Categories : Javascript

JQuery Scroll controls opacity of a Nav to fade in, how to stop Nav fading out on reverse scroll?
Use this: (woking jsFiddle) function EasyPeasyParallax() { scrollPos = $(document).scrollTop(); $('#nav').css({ 'opacity': 0+(Math.min(scrollPos/800,1)) }); }; $(function(){ $('body').bind('mousewheel',EasyPeasyParallax); }); Note: I've used mousewheel event however you can detect the scroll in any way you'd like. also note Math.min() usage so the value of opacity will not exceed 1 Another note: use .stop().animate() instead of .css() for a nicer looking fade effect jsFiddle.

Categories : Jquery

jQuery fading "back to top" link. Page load link visibility
I tested the code below and it worked without problems <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { // hide #back-top first $("#back-top").hide(); // fade in #back-top $(function () { $(window).scroll(function () { if ($(this).scrollTop() > 500) { $('#back-top').fadeIn(); } else { $('#back-top').fadeOut(); } }); // scroll body

Categories : Javascript

Funny behavior in jqGrid
It's a little uncomfortable, but the onclickSubmit of form editing has no rowid parameter. You can get it from postdata: onclickSubmit: function (options, postdata) { var rowid = postdata[this.id + "_id"]; // postdata.list_id ... } By the way to be exactly the second parameter of onclickSubmit in case of Delete operation is also postdata which is rowid only if musltiselect: true option is not set or if selected only one row. If multiselect: true are used and more as one row selected to delete then postdata will be comma separated string with ids of deleting rows (see the documentation).

Categories : Function

spyderlib funny behaviour with any() and all()
Here's a quote from another related question about Spyder's Python console behavior: One of Spyder's primary design goals is to make interactive scientific computing as painless as possible. To facilitate that, by default Spyder launches a custom-tailored interactive Python session at startup. It achieves this customization by setting an environment variable called PYTHONSTARTUP which specifies the path to a script that will be executed at interpreter startup. You can control this setting under Preferences...Console...Advanced settings. By default, Spyder points to scientific_startup.py, which imports a whole host of scientific modules and functions directly into the main namespace so that quick, interactive exploration is easy. As a consequence, the behavior you ar

Categories : Python

A funny thing with sprintf
Use %llu format string for task_id in sprintf()as follows: sprintf(sql, "%llu, %u", task_id, app_id); // ^ // for: long long unsigned int Edit: As @Simonc suggested its better to use: PRIu32 and PRIu64 macros defined in <inttypes.h> (as you have Linux tag) do like: sprintf(sql, "%"PRIu64", %"PRIu32"", task_id, app_id); // ^ ^ // for: uint64_t uint32_t

Categories : C

jQuery fadeIn effect not working its Flicker which apply on 2 divs, but show/hide works perfect need to change bg image with fading effect
You are showing two div, but making fadeIn effect uopn a single one. You need to apply the effect to both, $("#OneDiv").fadeIn(400); $("#Tab1Btn").fadeIn(400); Check this http://jsfiddle.net/yUKdh/7/ Note: Just applied the effect to mouse events of the start#

Categories : Jquery

PDF shows weird and funny characters
The problem is the font Devlys-010 is used in the document but the font is not embedded. The font cannot be located on the local machine so it is substituted. The solution is to recreate the document and embed all the fonts. PS: The question is not related to programming at all.

Categories : Pdf

Xamarin - "Funny RefName" when publishing to BitBucket
It is more of a workaround than a solution, but it might help some people, especially git beginners. I'm simply using git command line for commits and pushes. As far as you can commit from Xamarin, in my case it takes really long time. If this doesn't happen for you, whenever you want to push, you can just write: git push -u origin master And for making commits outside IDE: git commit -am 'commit message'

Categories : GIT

Funny Shell Output: [01;32mtestfile.txt[00m instead of testfile.txt
This is a TOTAL shot in the dark, but that looks like either a UNIX/Windows text encoding issue or perhaps there are some UNIX color codes that aren't getting parsed correctly. I have seen that before - usually in older shells on Unix/Linux that didn't have color support or with Cygwin shells that were sshed into a UNIX machine that invoked an old c-shell terminal (we run some very old Solaris 8 machines - barf). I'm not sure if that helps, but maybe gives you something to think about.

Categories : Java

jQuery: Image fading to another image
Use two different images. Have them cover the same space by setting their css properties "position: absolute". Fade the first one out while setting the other one to false. You may need a proper container with position: relative as position: absolute may cause them to behave...unexpectedly. #container{ position: relative; width: 100px; height: 100px; } .img1, .img2{ position: absolute; width: 100%; }

Categories : Javascript

Why is this only fading In and not fading out
If you create a new glowView every time the button is pressed and add it to the button, then obviously it will just keep getting brighter, as more and more of them are being added to the button. You need to create the glowView once, for example in your viewDidLoad method, and store it as an instance variable so you don't lose it: @interface MyViewController : UIViewController { UIView *_glowView; } ... - (void)viewDidLoad { [super viewDidLoad]; _glowView = ... // Initialise it here ... [imageView.superview insertSubview:_glowView aboveSubview:imageView]; } Then in your didTapButton: method, you handle the tap as you do (adding or removing the _glowView, but make sure you don't set it to nil so the reference to it is always retained). This way, you only create and a

Categories : IOS

Div fading in and out
If you can use Jquery, the following code will help you do it as i got what you want: this is default css: .invisElem{display:none} and the jquery code: $('body').on('click', '.boxbutton1', function(){ var counter = $(this).data('count'); if(counter == undefined){ counter = 0; setTimeout(function() { $('.gymtext').fadeIn(500)//fadeIn after 2 seconds(2000 ms) }, 2000); } else if(counter == 0){ $('.gymtext').fadeOut(function(){ $('.gymtext').remove() });//fadeout quickly then remove } }) i tried to write it down novice friendly if you needed help add comment

Categories : Javascript



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