w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Object.defineProperty the prop invisible under chrome devtool
My question is, why the property is invisible under Chrome developer tools object property list? Answer is: it is visible, but now it is a getter and setter. Object {} get p: function () { set p: function (val) { __proto__: Object jsfiddle If though, you are asking why you can't see it's value: that's because the value is now private and can only be read by using the getter. console.log(o.p); Update: Read Mutator method Mutator method From Wikipedia, the free encyclopedia In computer science, a mutator method is a method used to control changes to a variable. They are also widely known as '''setter''' methods. Often a setter is accompanied by a '''getter''' (also known as an accessor), which returns the value of the private member variable. The mutator meth

Categories : Javascript

How to retrieve the Initiator of a request when extending Chrome DevTool?
You are correct in that the initiator is not exposed through devtools extensions API -- currently, the resource properties that the API exposes are limited to that in HAR specification, which does not include initiator. You can use raw DevTools protocol (https://developers.google.com/chrome-developer-tools/docs/debugger-protocol) to get all data available to the DevTools front-end. Note that it is exposed to Chrome extensions as well (http://developer.chrome.com/extensions/debugger.html), but you can't use it when the DevTools front-end is opened, so you won't be able to access it in a DevTools extension. Depending on what you're trying to do, experimental Timeline API may be of some use (this test shows how this is done: https://code.google.com/p/chromium/codesearch#chromium/src/third_pa

Categories : Javascript

What's the differences between rending and painting event in Chrome DevTool Timeline View
Rendering events are about computing styles associated with each DOM node (i.e. "Style Recalculate") and elements position on the page ("Layout"). Paint category is about actually painting pixels and includes events like "Paint" itself and "Decode Image" / "Resize Image". In a nutshell, it's about inner structure vs. appearance -- if your page spends a lot of time rendering, this is because of the structure of its DOM and CSS (e.g. a large DOM tree), while significant paint times often mean the appearance of the page is affecting the performance (e.g. some styles are expensive to paint or an image is too large).

Categories : Google Chrome

iOS 7 Safari: prevent UI chrome appearing differently on scroll up and scroll down
Just as an update to this: We eventually worked around this issue by using bottom: 0; instead of top: 100%; in the CSS. We had wanted to use top: 100% in the first instance as it meant that items being added into that element would be rendered down (off screen) automatically. By taking the inverse approach we just have to manually translate the area off (using JS) an equal amount as the item being added. This results in out 'sticky' footer staying above the bottom piece of OS chrome when that appears.

Categories : Iphone

Simple highlight text chrome extension
The purpose of the content script is to gather data or make changes to the pages you are browsing using CSS and/or JavaScript. So what you need to do is put the makeEditableAndHighlight() and highlight() functions in a content script, and load it up in the manifest file like this: "content_scripts": [ { "matches" : [ "<all_urls>" ], "js" : [ "content.js" ] } ], So then you just need to trigger the highlight() function. There are a few ways to do this, but one way is simply to call "executeScript()" in the background page. For example (and I admit this is quick and dirty), put this at the top of your content script: highlight('yellow'); Then in your background.js file run the content script when the popup button is

Categories : Javascript

Highlight text feature in browser (Chrome) which looks like highlighting in android
i think this might help.. var divs = document.getElementsByTagName("p"); for(var d in divs) { // highlight a part of a <p> tag divs[d].addEventListener('mouseup',function(){var str= document.getSelection() ;alert(str); this.innerHTML =this.innerHTML.replace(str,'<span style="background-color: '+'yellow'+' ">'+str+'</span>'); }); } And more of it can be found in here

Categories : Javascript

Disable scroll in Chrome
Try UPDATE Image HTML <div id="wrapper"> <div></div> </div> <span>Test</span> CSS: #wrapper { margin: 0 auto; position: relative; height:580px; } body { min-height: 580px; overflow: hidden; } div{ height:2000px; width:1300px; position: relative; background-image:linear-gradient(blue, red); } html { overflow: auto; }

Categories : HTML

CSS "overflow:scroll" not working for chrome
All the CSS you need: #iframeid{ height:500; width:1150 overflow:scroll; } Works for me in Chrome: http://jsfiddle.net/ukcG9/6/

Categories : CSS

How can get a scroll event work in Chrome and Firefox?
You can try the following link From the page: onmousewheel event and Firefox's equivalent var mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel" //FF doesn't recognize mousewheel as of FF3.x if (document.attachEvent) //if IE (and Opera depending on user setting) document.attachEvent("on"+mousewheelevt, function(e){alert('Mouse wheel movement detected!')}) else if (document.addEventListener) //WC3 browsers document.addEventListener(mousewheelevt, function(e){alert('Mouse wheel movement detected!')}, false)

Categories : Javascript

Prevent scroll-bar from adding-up to the Width of page on Chrome
All you need to do is add: html { overflow-y: scroll; } In your css file as this will have the scroller whether it is needed or not though you just won't be able to scroll This means that the viewport will have the same width for both

Categories : HTML

firefox won't scroll wordpress website but works in chrome and ie
body { font:300 14px/1.4; font-family: 'Lobster', cursive; color:#19150b; overflow:hidden; padding:0!important; background: url(img/background.png) repeat; } remove overflow:hidden in this class

Categories : Firefox

navbar collapses on mobile with chrome/safari on scroll
Fairly simple problem. A mobile device does not have a constant mouse. Which means hovering wont work!. Make a simple work around like: Click once to open menu -> Click agian to click on menu item -> and close menu When open and user doesnt want to click on any menu item -> Click next to the menu -> close the menu Fairly simple really, goodluck

Categories : Javascript

mobile chrome fires resize event on scroll
This is a duplicate of Javascript resize event on scroll mobile In order to fix it, use onOrientationChange and window.orientation property. See the related answer: here

Categories : Android

Chrome: Scroll on
It is the bug in chrome SELECT box with MULTIPLE option fires ONCHANGE event on scroll and here

Categories : Javascript

how remove horizontal scroll bar for iframe on google chrome
If you have access to iframe source page you can place body { overflow-x:hidden; } inside of that page. If you don't, but at least pages are from the same domain, I believe something like this from the parent page should work: #myiframe body { overflow-x:hidden; } If none of the above is true - you can simulate "overflow-x: hidden" by actually hiding the horizontal scrollbar inside of the iframe container. Place Iframe into a container DIV of a lesser height, e.g.: <div id="myiframecontainer"> <iframe id="myiframe" src="http://en.wikipedia.org" /> </div> #myiframecontainer { width:600px; height:400px; overflow:hidden; } #myiframe { width:100%; height:420px; } Since iframe height is bigger than div's height and div's overflow i

Categories : HTML

jQuery issues (Safari/Chrome) with smooth scroll
This issue with smoothScroll solved my problem. https://github.com/kswedberg/jquery-smooth-scroll/issues/29

Categories : Javascript

Showing a youtube video with fancyBox, scroll is enabled in chrome only
Ended up having to hook into the afterShown and afterClose callbacks and manually disable the scroll as there doesn't appear to be an official fix for this. <script type="text/javascript"> $(document).ready(function () { $('.fancybox-media').fancybox({ openEffect: 'none', closeEffect: 'none', afterShow: shown, afterClose: closed, helpers: { media: {} } }); }); function shown() { $('html, body').css({ 'overflow': 'hidden', 'height': '100%' }); } function closed() { $('html, body').css({ 'overflow': 'auto', 'height': 'auto' }); } </script> Hopefully this helps someone el

Categories : Jquery

Prevent browser(Chrome) to run default functions like scroll with space
How about combine these two function into one: $(document).on("keydown", function (evt) { { evt.preventDefault(); evt = evt || window.event; var charCode = evt.keyCode || evt.which; document.getElementById("current").innerHTML=charCode; } });

Categories : Javascript

Shadow of scroll bar appearing on top of overlay animation in Chrome and Safari
Played around and finally figured a way out: make $("div").css({"overflow-y":"hidden","overflow-x":"hidden"}); before animation starts, then $("div").css({"overflow-y":"","overflow-x":""}); after animation finishes.

Categories : Javascript

Chrome and IE: parallax (jQuery animate) is not smooth when using mouse wheel to scroll
I solved the problem with this jQuery script (which adds EventListener for both keyboard and mouse scroll), hope it helps. :) if (window.addEventListener) window.addEventListener('DOMMouseScroll', wheel, false); window.onmousewheel = document.onmousewheel = wheel; var time = 1300; var distance = 270; function wheel(event) { if (event.wheelDelta) delta = event.wheelDelta / 120; else if (event.detail) delta = -event.detail / 3; handle(); if (event.preventDefault) event.preventDefault(); event.returnValue = false; } function handle() { $('html, body').stop().animate({ scrollTop: $(window).scrollTop() - (distance * delta) }, time); } $(document).keydown(function (e) { switch (e.which) { //up case 38: $('html, body').s

Categories : Javascript

Getting the current scroll position in Chrome using scrollTop() on page load/refresh
The scrollTop() returns the current vertical position of the scroll bar. Typically on page load, the scroll bar is at position 0. If the console prints out something else, then you or the browser must have scrolled down before running the method. If you are using named anchors or refreshing the page from a scrolled position, you can bind a handler to the scroll event that only triggers once - on page load: $(window).one('scroll', function() { console.log( $(this).scrollTop() ); });

Categories : Jquery

Hover highlight child should not highlight parent
Try $(document).ready(function (){ $("body").mouseover(function (e){ $(e.target).addClass('test'); }).mouseout(function (e) { $(e.target).removeClass('test'); }); }); Demo: Fiddle

Categories : Javascript

highlight words on page just like jQuery.highlight()?
If you know what words need to be highlighted, just make a css class higlight and use as follows:<span class='highlight'>My highlighted text</span>. As for the css, use for example .highlight{ background-color: yellow; } You can also use str_replace to replace certain words, like so: str_replace( $word, '<span class="highlight">'.$word.'</span>', $mytext) $mytext would obviously be the the whole text, and $word the word you wish to highlight. You could make an array of words that need to be highlighted and just do a foreach().

Categories : PHP

jsf2 highlight components with FacesMessages (o:highlight)
Now i wonder if it would be possible to have this behavior depended on the List of Ids with Messages. From the javadoc of the very same method as you linked there: Note that the FacesContext#getClientIdsWithMessages() could also be consulted, but it does not indicate whether the components associated with those client IDs are actually UIInput components which are not UIInput#isValid(). So, you would for every single client ID still need to use UIViewRoot#findComponent() in order to find the component, figure its type and verify the validity. This is much more expensive than a single tree visit. If you really need to perform validation in action method, your best bet is to mark the context and inputs as invalid yourself. FacesContext context = FacesContext.getCurrentInstance();

Categories : JSF

AJAX chat scroll If has more than 20-30 messages, scroll to bottom will work if user didnt scroll up
Like this: http://jsfiddle.net/eP24K/2/ (see html/css to go along with below code) function insertLine() { var scrollPosition = $("#chat").scrollTop(); var scrollHeight = $("#chat")[0].scrollHeight; //console.log(scrollPosition,scrollHeight); $("#chat").append("<div>James: Hello World!</div>"); if (scrollPosition+$("#chat").height() === scrollHeight) { $("#chat").scrollTop(scrollHeight); } setTimeout(function(){ insertLine(); }, (Math.floor(Math.random()*1000))) } insertLine(); The code is in no way optimized, it's just concept.

Categories : Javascript

How to make a scroll area hide x & y both scroll bar, but only enable horizontal scroll?
Try adding an extra div between outer & inner called middle & use this CSS: http://jsbin.com/acexuq/3/ #outer { overflow:hidden; width: 400px; height: 400px; } #inner { overflow:auto; width:4000px; height:400px; } #middle { overflow: scroll; width:417px; height:417px; }

Categories : Jquery

JS - jQuery - Tw Bootstrap - block user to scroll body but show scroll bars
Just set a scroll event and put the scrollTop back to 0 or the last known position, then unbind the scroll event when done. function modals(){ $('.modal').hide(); $('.modal').on('show shown',function(){ var top = $("body").scrollTop(); (function(pos) { $(window).scroll(function(e) { $("body").scrollTop( 0 ); //OR $("body").scrollTop( pos ); }); })(top); }); $('.modal').on('hide hidden',function(){ $(window).unbind("scroll"); }); }

Categories : Javascript

Stacked horizontal divs along bottom is hiding scroll bars under container scroll bar
Chrome was doing something wacky with positioning. Padding-bottom: 20px seemed to fix it in Chrome without screwing over IE or Firefox. I did not test on Safari, but it should work there too. body { overflow: scroll; } .outer { position: fixed; height: 200px; bottom: 0; left: 0; width: 100%; overflow-y: auto; border: 1px solid red; white-space: nowrap; padding-bottom: 20px; } .window { border: 1px solid blue; background-color: White; width: 200px; height: 100%; display:inline-block; white-space:normal; } .heading { color: purple; background-color: #c0c0c0; } .list { overflow-y: scroll; height: 100%; }

Categories : CSS

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

hiding soft input in android app causes scroll view to scroll to bottom
You should only need to call hideSoftInputFromWindow() once, and try using InputMethodManager.HIDE_NOT_ALWAYS instead of "0" for the flag. EDIT: Try adding android:windowSoftInputMode="adjustPan" to your manifest.

Categories : Android

How can I set the scroll position relative to the click event and the initial scroll after resizing the inner div?
I managed to solve it after some headaches: parent.scrollLeft = (clientX + parent.scrollLeft ) * ratio - clientX; parent.scrollTop = (clientY + parent.scrollTop ) * ratio - clientY;

Categories : Javascript

Ugly scroll bars with overflow: scroll in Safari, Firefox
maybe wanted something like this, if so please refere to this; for the jquery solution : i found this (demo) $('#scrollbar1').tinyscrollbar();

Categories : CSS

vertical scroll bar not visible inside horizontal scroll bar android
Just remove android:fadeScrollbars="false" line or make it true. Read here. android:fadeScrollbars => Defines whether to fade out scrollbars when they are not in use. Edit Try following two lines in your views. I remove line android:fadeScrollbars="false" and add below 2 lines. android:scrollbarFadeDuration="0" android:scrollbarDefaultDelayBeforeFade="0"

Categories : Android

How to make content scroll smoothly in fixed div with page scroll
Since you cannot control the users CPU, browser, browser version, even graphics card, etc. there is not much you can do. You could try to use vanilla JavaScript instead of jQuery to improve performance a bit, but its probably not going to help much (it may not change anything depending of if its the render or the script interpreter who is slow). In my browser, for instance, your example works quite smoothly. It really depends on your client how it will look, that's just the web. Don't worry too much about it. Finally there are 2 things I noticed: You don't have to set "position: relative" each a scroll event is received, just set it once in your stylesheet If one scrolls too fast the menu gets stuck in an odd position Here is the code to fix the above issue although it may not fix the

Categories : Jquery

jQuery Scroll function : Scroll Top and Window Height 1px discrepancy in value
It is because the browser sometimes adds its own stylesheet as well. That may be the cause of your issue. Try using reset.css. It resets all the browser default css. And its always a good practice to trigger infinite scroll from around 50px of the bottom. You dont wanna have the user to scroll to "the very end" to show next content.

Categories : Jquery

How to make if scroll distance bigger than half img width, than scroll right to next?
$('.scroll').bind("scrollstop",function() { // console.log("Scroll Stopped"); // console.log($(this).scrollLeft()); stopx = $(this).scrollLeft(); var dist = (stopx - startx); $(this).animate({'scrollLeft':Math.round(dist/800) * 800+'px'},500); })

Categories : Jquery

Android ListView resets scroll position after first scroll
I'm not sure but I think when you call removeAllViews for some reason it can't save the previous state. I'm not sure again if it is the best way to solve the problem but what you can do is to save your scroll position before remove it, and after add your views again you can set it. Something like this: int posX = listView.getScrollX(); //remove your view and after: //add your views listView.setScrollX(posX);

Categories : Android

Android Browser disabling x scroll disables y scroll as well
I´m having a similar problem but from what i saw up to now what´s preventing the scroll is height: 100%; Try commenting that lien for Android 2.X and you´ll probably get it to scroll again. Please let know if you find a way in which you can keep html, body { height: 100%; } And still scroll. Thanks and good luck-

Categories : Android

Scroll view scroll indicator visible despite being turned off
The horizontal and vertical indicators are type of UIImageView by default. So, if you want to remove it permanently then do this //Assuming myScrollView is of type UIScrollView - (void)viewDidLoad { [super viewDidLoad]; for(UIView *subview in myScrollView.subviews){ [subview removeFromSuperview]; } }

Categories : IOS

Easy Smooth Scroll Plugin: How do I offset scroll?
I had a similar issue and found that the following solution worked for me. Change the line: var desty = destinationLink.offsetTop; to read: var desty = destinationLink.offsetTop - 120; (where '120' is the height in pixels of your fixed header) Then, remove the line: location.hash = anchor; (otherwise, the page will scroll to your 120px offset but then return back to the location of the anchor) Hope this helps!

Categories : Javascript



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