Search Results

Search found 314 results on 13 pages for 'sliding'.

Page 11/13 | < Previous Page | 7 8 9 10 11 12 13  | Next Page >

  • CSS Design question, I've got myself completely turned around.

    - by Matt Dawdy
    Okay, I have a couple of other questions out there, but I think I'd better just ask from the beginning how you CSS experts would do this. Client's page is split into 2 rows -- header has some info, some aligned to left of page, some to right, some in the middle. This is currently done using a table. I'm fine with leaving this alone or changing it. My real question is that I need a page layout to handle the following: 2 columns - column on left is 200px, but can be "close" down to to 10px (not a slider, it's either 200 or 10 px). The column on the right needs to be as big as it needs to be -- which might be larger than the width of the page. When left column is "closed" then the right column slides over of course. Again, this right column might be 300px or it might be 4000 pixels (it's a reporting interface). Now, to add another wrinkle, SOME pages have 3 columns. The first 2 columns are each exactly 200px, and both can be "closed" down to 10 px each. But, the user may not close both columns, maybe just 1. Or none. Or both. The third column needs to act just like I described above, being able to be larger than the page width, and sliding over to take advantage of any of the "closed" left columns. Whew! I'm pretty confused as to how to go about this, as either I get it right but I can't scroll over to the right at all (overflow: hidden) and information is lost, or the right column jumps down below the left 2 columns and just looks plain stupid. My minimum browser requirements are IE8, FF3.5, Chrome and Safari (latest versions of all). Any and all pointers are gladly accepted.

    Read the article

  • Adaptive user interface/environment algorithm

    - by WowtaH
    Hi all, I'm working on an information system (in C#) that (while my users use it) gathers statistical data on what pieces of information (tables & records) each user is requesting the most, and what parts of the interface he/she uses most. I'm using this statistical data to make the application adaptive to the user's needs, both in the way the interface presents itself (eg: tab/pane-ordering) as in the way of using the frequently viewed information to (eg:) show higher in search results/suggestion-lists. What i'm looking for is an algorithm/formula to determine the current 'hotness'/relevance of these objects for a specific user. A simple 'hitcounter' for each object won't be sufficient because the user might view some information quite frequently for a period of time, and then moving on to the next, making the old information less relevant. So i think my algorithm also needs some sort of sliding/historical principle to account for the changing popularity of the objects in the application over time. So, the question is: Does anybody have some sort of algorithm that accounts for that 'popularity over time' ? Preferably with some explanation on the parameters :) Thanks! PS I've looked at other posts like http://stackoverflow.com/questions/32397/popularity-algorithm but i could't quite port it to my specific case. Any help is appreciated.

    Read the article

  • Optimization headers for UITableView?

    - by Pask
    I have an optimization problem for the headers of a table with plain style. If I use the standard view for the table (the classic gray with titles set by titleForHeaderInSection:) everything is ok and the scrolling is smooth and immediate. When, instead, use this code to set my personal view: - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { return [self headerPerTitolo:[titoliSezioni objectAtIndex:section]]; } - (UIImageView *)headerPerTitolo:(NSString *)titolo { UIImageView *headerView = [[[UIImageView alloc] initWithFrame:CGRectMake(10.0, 0.0, 320.0, 44.0)] autorelease]; headerView.image = [UIImage imageNamed:kNomeImmagineHeader]; headerView.alpha = kAlphaSezioniTablePlain; UILabel * headerLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease]; headerLabel.backgroundColor = [UIColor clearColor]; headerLabel.opaque = NO; headerLabel.textColor = [UIColor whiteColor]; headerLabel.font = [UIFont boldSystemFontOfSize:16]; headerLabel.frame = CGRectMake(10.0,-11.0, 320.0, 44.0); headerLabel.textAlignment = UITextAlignmentLeft; headerLabel.text = titolo; [headerView addSubview:headerLabel]; return headerView; } scrolling is jerky and not immediate (sliding the finger on the screen does not match an immediate shift of the table). I do not know what caused this problem, maybe the fact that every time the method viewForHeaderInSection: is called, the code runs to create a new UIImageView. I tried many ways to solve the problem, such as creating an array of all the necessary view: apart from more time spent loading at startup, there is a continuing problem of low reactivity of the table. 've Attempted by reducing the size of UIImageView positioned from about 66 KB to 4 KB: not only has a deterioration in quality of colors (which distorts a bit 'original graphics), but ... the problem persists! Perhaps you have suggestions about it, or know me obscure techniques that enable me to optimize this aspect of my application ... I apologize for my English, I used Google for translation.

    Read the article

  • Android "first time" app user tutorial

    - by EGHDK
    I'm trying to create an opening tutorial that consists of four panes for my application, but since I'm new to Android, I want to make sure I'm considering all of my options before marking this task as "complete". I know of three ways, I can only really accomplish one. There are no requirements for this tutorial, but some "wanted features" would be a sliding action to each pane would be nice as well as the image and the bottom (navigation circles) not moving and the title on top not moving. One Way 4 separate activities and 4 separate layouts The red circled items are textViews that are centered horizontally and pushed off the top. The white circled items are imageViews that are centered horizontally and vertically. The purple circled are imageViews that are centered horizontally and pushed off the bottom. Second Way 4 fragments on one activity Fragments were difficult to learn, but the more I read about them/see tutorials on them, they seem to only really be used for tablets. Would it be a valid way to accomplish this? Third Way ViewPager? http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html I've never used this before, but I know it's an option. Final Question Which way is used more often/what's the proper way to implement this? Is there any way to only have the middle part (the image) slide in, but the title (top) and the navigation images (bottom) just change once the image slides in?

    Read the article

  • WPF - data binding trigger before content changed

    - by 0xDEAD BEEF
    How do i create trigger, which fires BEFORE binding changes value? How to do this for datatemplate? <ContentControl Content="{Binding Path=ActiveView}" Margin="0,95,0,0"> <ContentControl.Triggers> <--some triger to fire, when ActiveView is changing or has changed ?!?!? --> </ContentControl.Triggers> public Object ActiveView { get { return m_ActiveView; } set { if (PropertyChanging != null) PropertyChanging(this, new PropertyChangingEventArgs("ActiveView")); m_ActiveView = value; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("ActiveView")); } } How to do this for DataTemplate? <DataTemplate DataType="{x:Type us:LOLClass1}"> <ContentControl> <ContentControl.RenderTransform> <ScaleTransform x:Name="shrinker" CenterX="0.0" CenterY="0.0" ScaleX="1.0" ScaleY="1.0"/> </ContentControl.RenderTransform> <us:UserControl1/> </ContentControl> <DataTemplate.Triggers> <-- SOME TRIGER BEFORE CONTENT CHANGES--> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="shrinker" Storyboard.TargetProperty="ScaleX" From="1.0" To="0.8" Duration="0:0:0.3"/> <DoubleAnimation Storyboard.TargetName="shrinker" Storyboard.TargetProperty="ScaleY" From="1.0" To="0.8" Duration="0:0:0.3"/> </Storyboard> </BeginStoryboard> </-- SOME TRIGER BEFORE CONTENT CHANGES--> </DataTemplate.Triggers> </DataTemplate> How to get notification BEFORE binding is changed? (i want to capture changing Visual component to bitmap and create sliding view animation)

    Read the article

  • Ajax request using mootools not working

    - by benny
    Hi everyone, I try loading content into a div with this tutorial. Unfortunately, this simply loads the HTML file as a new page. This is the javascript that should do the job window.addEvent('domready', function() {      $('runAjax').addEvent('click', function(event) {          event.stop();          var req = new Request({              method: 'get',              url: $('runAjax').get('href'),              data: { 'do' : '1' },              onRequest: function() { alert('The request has been made, please wait until it has finished.'); },   onComplete: function(response) { alert('Response received.); $('container').set('html', response); }          }).send(); $('runAjax').removeEvent('click');      }); }); this is the link that should initiate the function <a href="about.html" id="runAjax" class="panel">Profil</a> and this is the div-structure of index.html. i want the content to be loaded into the "container"-div <div id="view"> <div id="sidebar"> mib </div> <div id="container"> <div id="logo"> <!--img src="img/logo.png"--> </div> <div align="center" id="tagline"> content </div> </div> </div> I dont really care what script i use as long as its compatible with MooTools 1.2, because i need it for a sliding top panel and it would be a lot more work to change it to a jquery panel for example.

    Read the article

  • Mootools Javascript can't push to array

    - by nona
    I have an array set with the heights of each hidden div, but when I use it, the div instantly jumps down, rather than slowly sliding as when there is a literal number. EDIT: testing seems to reveal that it's a problem with the push method, as content_height.push(item.getElement('.moreInfo').offsetHeight);alert(content_height[i]);gives undefined, but alert(item.getElement('.moreInfo').offsetHeight); gives the correct values Javascript: window.addEvent('domready', function(){ var content_height = [];i=0; $$( '.bio_accordion' ).each(function(item){ i++; content_height.push( item.getElement('.moreInfo').offsetHeight); var thisSlider = new Fx.Slide( item.getElement( '.moreInfo' ), { mode: 'horizontal' } ); thisSlider.hide(); item.getElement('.moreInfo').set('tween').tween('height', '0px'); var morph = new Fx.Morph(item.getElement( '.divToggle' )); var selected = 0; item.getElement( '.divToggle' ).addEvents({ 'mouseenter': function(){ if(!selected) this.morph('.div_highlight'); }, 'mouseleave': function(){ if(!selected) { this.morph('.divToggle'); } }, 'click': function(){ if (!selected){ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; item.getElement('.moreInfo').set('tween', { duration: 1500, transition: Fx.Transitions.Bounce.easeOut }).tween('height', content_height[i]); //replacing this with '650' keeps it smooth selected = 1; thisSlider.slideIn(); } else{ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; thisSlider.slideOut(); item.getElement('.moreInfo').set('tween', { duration: 1000, transition: Fx.Transitions.Bounce.easeOut }).tween('height', '0px'); selected = 0; } } }); } ); }); Why could this be? Thanks so much!

    Read the article

  • Why jquery have problem with onbeforeprint event?

    - by Cesar Lopez
    Hi all, I have the following function. $(function() { $(".sectionHeader:gt(0)").click(function() { $(this).next(".fieldset").slideToggle("fast"); }); $("img[alt='minimize']").click(function(e) { $(this).closest("table").next(".fieldset").slideUp("fast"); e.stopPropagation(); return false; }); $("img[alt='maximize']").click(function(e) { $(this).closest("table").next(".fieldset").slideDown("fast"); e.stopPropagation(); return false; }); }); <script type="text/javascript"> window.onbeforeprint = expandAll; function expandAll(){ $(".fieldset:gt(0)").slideDown("fast"); } </script> For this html <table class="sectionHeader" ><tr ><td>Heading 1</td></tr></table> <div style="display:none;" class="fieldset">Content 1</div> <table class="sectionHeader" ><tr ><td>Heading 2</td></tr></table> <div style="display:none;" class="fieldset">Content 2</div> I have several div class="fieldset" over the page, but when I do print preview or print, I can see all divs sliding down before opening the print preview or printing but on the actual print preview or print out they are all collapse. I would appreciate if anyone comes with a solution for this. Anyone have any idea why is this or how to fix it? Thanks. PS:Using a does not work either ( I assume because jquery using toggle) and its not the kind of question I am looking for.

    Read the article

  • Partial slideDown with jQuery

    - by Jon
    I have some buttons that have drawer menus and what I'd like to do is add a state so that when the user hovers over the button, the drawer bumps out slightly (maybe with a little wiggle/rubber-banding) so that they know that there's a drawer with more information. I have the sliding working and a hover function set up, but I don't know how to implement a partial slideDown. Any ideas? FIDDLE. Code: <div class="clause"> <div class="icon"><img src="http://i.imgur.com/rTu40.png"/></div> <div class="label">Location</div> <div class="info">Midwest > Indiana, Kentucky; Southwest > Texas, Nevada, Utah; Pacific > California, Hawaii</div> </div> <div class="drawer">Info 1<br/><br/></div> <div class="drawerBottom"></div> $(".clause").click(function() { var tmp = $(this).next("div.drawer"); if(tmp.is(":hidden")) tmp.slideDown('3s'); else tmp.slideUp('3s'); }); $(".clause").hover(function() { });

    Read the article

  • Stop animation on last element

    - by littleMan
    I have a sliding panel and on the last element I want the animation to stop i've tried using the .is(':last') and it doesn't stop. here is my code. the current var is set to the first element when the form loads. It animates to the left and keeps animating when you click the next button i just want to stop it on the last element jQuery('.wikiform .navigation input[name^=Next]').click(function () { if (current.is(':last')) return; jQuery('.wikiform .wizard').animate({ marginLeft: '-=' + current.width() + "px" }, 750); current = current.next();}); <div id="formView1" class="wikiform"> <div class="wizard"> <div id="view1" class="view"> <div class="form"> Content 1 </div> </div> <div id="view2" class="view"> <div class="form"> Content 2 </div> </div> </div> <div class="navigation"> <input type="button" name="Back" value=" Back " /> <input type="button" name="Next " class="Next" value=" Next " /> <input type="button" name="Cancel" value="Cancel" /> </div> </div>

    Read the article

  • jquery .show("slide") options (WITH PICS!!)

    - by Micky Fokken
    Here's my code. It slides in from the left. <script> $('#goalHS').click(function() { $('div[id^="div-detailed-goal"]').show("slide"); }); $("#redline").click(function() { $('div[id^="div-detailed-goal"]').fadeOut("slow"); }); </script> Instead of fading in from the left, I want a red line to be drawn and then have the DIV slide in from the top. How can I get it to do the following? Horizontal red line grows out from center. --- Red line finishes growing: Content slides in from underneath red line. COntent does NOT show above red line: c. content, content, content d. content, content, content Content finishes sliding in. Awesomeness ensues! a. content, content, content b. content, content, content c. content, content, content d. content, content, content I've tried 4 different ways, and I've tried using other js plugin libraries, but I'm not quite that advanced to figure it out.

    Read the article

  • How to limit TCP writes to particular size and then block untlil the data is read

    - by ustulation
    {Qt 4.7.0 , VS 2010} I have a Server written in Qt and a 3rd party client executable. Qt based server uses QTcpServer and QTcpSocket facilities (non-blocking). Going through the articles on TCP I understand the following: the original implementation of TCP mentioned the negotiable window size to be a 16-bit value, thus maximum being 65535 bytes. But implementations often used the RFC window-scale-extension that allows the sliding window size to be scalable by bit-shifting to yield a maximum of 1 gigabyte. This is implementation defined. This could have resulted in majorly different window sizes on receiver and sender end as the server uses Qt facilities without hardcoding any window size limit. Client 1st asks for all information it can based on the previous messages from the server before handling the new (accumulating) incoming messages. So at some point Server receives a lot of messages each asking for data of several MB's. This the server processes and puts it into the sender buffer. Client however is unable to handle the messages at the same pace and it seems that client’s receiver buffer is far smaller (65535 bytes maybe) than sender’s transmit window size. The messages thus get accumulated at sender’s end until the sender’s buffer is full too after which the TCP writes on sender would block. This however does not happen as sender buffer is much larger. Hence this manifests as increase in memory consumption on the sender’s end. To prevent this from happening, I used Qt’s socket’s waitForBytesWritten() with timeout set to -1 for infinite waiting period. This as I see from the behaviour blocks the thread writing TCP data until the data has actually been sensed by the receiver’s window (which will happen when earlier messages have been processed by the client at application level). This has caused memory consumption at Server end to be almost negligible. is there a better alternative to this (in Qt) if i want to restrict the memory consumption at server end to say x MB's? Also please point out if any of my understandings is incorrect.

    Read the article

  • jQuery get the value of ahref and put it to button

    - by user1506189
    i have this problem that i need to get the value of href and pass it to a button. is this correct format of jQuery? $(function() { var getValue = $('#theLink').getAttributeNode('onclick').value; $('.yt_holder').live('click', '.videoThumb4', function(){ $(".videoThumb4").ytplaylist({ holderId: 'ytvideo4', html5: true, playerWidth: '520', autoPlay: false, sliding: false, listsliding: true, social: true, autoHide: false, playfirst: 0, playOnLoad: false, modestbranding: true, showInfo: false }); }); }); the button was working but it only play the first video on his list. the link of the website is here http://cocopop12.site11.com/search/index.php now the button is this. <input class="videoThumb4" onClick="http://www.youtube.com/watch?v=' . $yValue['videoid'] . '" type="button" name="previewSel" value="Preview" id="previewbut" /> is that correct? that i need to do a onclick http://www.... blabla? the <a href> that i like to make a button is this. <?php echo ' <a class="videoThumb4" href="http://www.youtube.com/watch?v=' . $yValue['videoid'] . '" id="link"> ' . $yValue['description'] . ' </a> '; ?> how can i use .each for the button {Preview}? how can i put the value in the button just like --when i click this href it automatically play the video? but the button it just play the first video but not the second video. this i want to make it like a button. thank you for your time.

    Read the article

  • DIV inside TD to make it appear correctly

    - by Daniel Svensson
    Hi, I have a <table> generated from code-behind and now facing a problem. In one of the TD i need to have a DIV that is setup with JQuery so that when i click a link the DIV slideToggles. Now i need the TD belonging to that TR not to expand the TR. To solve this i have used an old trick that is to place the JQuery DIV inside another surrounding DIV with height 1px and make the TR not expanding with the heigth of the DIV that slides out. In IE the sliding DIV is partially under the table and in Firefox the DIV appears over the table but it's trasparent, the text from the data in the table shows thru. I have tried to alter the Z-index in various ways but it's no good. Anyone that has an idea or alternatively solution that has worked for them. HtmlGenericControl containerDiv = new HtmlGenericControl("div"); containerDiv.ID = "containerDiv"; containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Width, "100%"); containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Height, "1px"); containerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.ZIndex, "999"); HtmlGenericControl innerDiv = new HtmlGenericControl("div"); innerDiv.ID = System.Guid.NewGuid().ToString() + "_annualDiv"; inner.Style.Add(System.Web.UI.HtmlTextWriterStyle.Width, "100%"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.Height, "300px"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.ZIndex, "1000"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderStyle, "solid"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderColor, "Black"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BorderWidth, "1px"); innerDiv.Style.Add(System.Web.UI.HtmlTextWriterStyle.BackgroundColor, "white"); innerDiv.InnerHtml = "Here is a list of links coming later"; conDiv.Controls.Add(innerDiv);

    Read the article

  • JQuyer slide and stop issues: animated element freezes with quick mouse movement

    - by sherlock
    Here is Zi JsFiddle. In order to replicate my issue you have to hover over the link that says 'javascript', then mouseout that, then mouseback in. If you do this before the animation is complete, the pink slidedown #subMenu will freeze midway through sliding. Is there a way to prevent this from happening? I have tried some .stop()s , but i really don't want the animation to re-start every time you mouseenter or leave the .navLink . The animation should begin from where it left off. In other words, if the pink section is halfway down, and a slideDown() gets executed, the pink should not dissappear and then slide down, it should slide down from where it is. Thanks!! JS: $('header#subHeader').hide(); $('.navLink').hover(function () { if ($(this).children('div').length > 0) { var subMenu = $(this).find('.subMenu').html(); $('header#subHeader').empty().append('<div>' + subMenu + '</div>').stop().slideDown(); } else { $('header#subHeader').stop().slideUp(); } }); $('hgroup:first').on('mouseleave', function(){ $('header#subHeader').slideUp(); });

    Read the article

  • What are good examples of perfectly acceptable approaches to development that are NOT test driven development (TDD)?

    - by markbruns
    The TDD cycle is test, code, refactor, (repeat) and then ship. TDD implies development that is driven by testing, specifically that means understanding requirements and then writing tests first before developing or writing code. My natural inclination is a philosophical bias in favor of TDD; I would like to be convinced that there are other approaches that now work well or even better than TDD so I have asked this question. What are examples of perfectly acceptable approaches that NOT test driven development? I can think of plenty approaches that are not TDD but could be a lot more trouble than what they are worth ... it's not moral judgement, it's just that they are cost more than they are worth ... the following are simply examples of things that might be ok as learning exercises, but approaches I'd find to be NOT acceptable in serious production and NOT TDD might include: Inspecting quality into your product -- Focusing efforts on developing a proficiency in testing/QA can be problematic, especially if you don't work on the requirements and development side first ... symptom of this include bug triaging where the developers have so many different bugs to deal with it, it is necessary to employ a form of triage -- each development cycle gets worse and worse, programmers work more and more hours, sleep less and less, struggle to keep going in death march until they are consumed. Superstition ... believing in things that you don't understand -- this would involve borrowing code that you believe has been proven or tested from somewhere, e.g. legacy code, a magic code starter wizard or an open source project, and you go forward hacking up a storm of modifications, sliding FaceBook Connect into your the user interface, inventing some new magic features on the fly (e.g. a mashup using the Twitter API, GoogleMaps API and maybe Zappos API), showing off your cool new "product" to a few people and then writing up a simple "specification" and list of "test cases" and turning that over to Mechanical Turk for testing.

    Read the article

  • Setting Android webview initialScale prevents proper zooming

    - by Ryan
    Need: I want a webview to automatically be sized to fit the width of that particular page. I have Googled this and found several different suggestions. Most of them work. But then each of them effects zooming in / zooming out. What I'm looking for is a solution that accomplishes both. The webview is initially set to fill the screen, but then it allows the user to zoom in (with pinching) and zoom out. What I've Tried: mainView.getSettings().setLoadWithOverviewMode(true); mainView.getSettings().setUseWideViewPort(false); mainView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); mainView.getSettings().setBuiltInZoomControls(true); mainView.getSettings().setSupportZoom(true); I have also tried setting mainView.setInitialScale(various percentages) Again, I have tried these in different orders, including some, not including others. Currently, if I use the above code and setInitialScale(65), it loads initially fine but then once you zoom in, you cannot zoom all the way back out. Does anyone know of the best practice to set initial scale to fit screen but fully allow zooming out and in? Why I Need It: I'm using a ViewFlipper in my Android app to load several webviews simultaneously. I have a touch sensor that allows sliding from left to right to switch between different webviews. The practical purpose of this is to show a grocery store's ads and allow the user to slide from page to page. The problem is that the API feed I'm using basically only allows me to load a URL for each page. So I have to use webviews.

    Read the article

  • Improving the efficiency of multiple concurrent Core Animation animations

    - by Alex
    I have a view in my app that is very similar to the month view in the built-in Calendar app. There's a subview that holds the individual cells (a custom UIView subclass that draws text into its layer), and when the user navigates to the next "month", I create the new cells and slide the view to show them. When the animation stops, I remove the old, hidden cells and set things up so it's ready to go for the next animation. This all works nicely. However, I'd like to animate the cells' text color, as in the Calendar app, so that the outgoing ones transition to a lighter color and the incoming ones transition to a darker color. The problems is that I can have as many as 70 cells, so doing individual animations is very slow -- between 5-10 fps on my iPhone 3GS. I'm trying to find a less computationally intense way of doing this. My reading of the Shark results is that the majority of the time is spent redrawing the text for each frame for each frame. This makes sense, since text rendering is hardly the cheapest operation. I've considered creating a second view -- one holding the "outgoing" state and one holding the "incoming" state and using a single opacity animation to gradually reveal the updated cells while both are sliding. I'm concerned that instead of having 70 cells, I'll have 140, which seems like a lot of views. So, is that too many views or would there be a better way of doing this?

    Read the article

  • iphone navigation

    - by Rona
    function handleClickEvent(event) { var linkFrom = $(event.target); if (typeof linkFrom.attr("href") == 'undefined') { linkFrom = $(event.target).parent(); } var targetPage = linkFrom.attr("href"); if (linkFrom.hasClass('submit')) { handleSubmitEvent(event); // if we want to stop processing: return false; } if (linkFrom.hasClass('backbutton')) { targetPage = historyStack.pop(); if (historyStack.length == 0) { lastPage = "index.html"; } } else { historyStack.push(lastPage); } lastPage = targetPage; $(event.target).css({ 'background-color': '#194fdb', 'color': '#ffffff' }); loadingWindowON(); // Add new unique div prevPageId = "page" + pageIdCounter; pageIdCounter = parseInt(pageIdCounter) + 1 nextPageId = "page" + pageIdCounter; nextPageDiv = "<div id='" + nextPageId + "' class='nextpage' /></div>"; $("body").append(nextPageDiv); if (linkFrom.attr("target") != "_blank") { event.preventDefault(); document.getElementById(nextPageId).addEventListener('webkitAnimationEnd', function () { // remove prev div element = document.getElementById(prevPageId); if (element) { element.parentNode.removeChild(element); } // set next div as current document.getElementById(nextPageId).className = 'currentpage'; }, false); document.getElementById(nextPageId).className += ' slideleftIn'; document.getElementById(prevPageId).className += ' slideleftOut'; loadContent(targetPage, nextPageId); } I use this javascript with a twitter app I had to do and when I click a button, instead of sliding the new page from the side it adds it to the existing page at the bottom. It works fine when i open it on my computer using google chrome but when I try to open it with my iphone it doesn't work. Any ideas?

    Read the article

  • How do you have jquery slide up and down on hover without distorting shape?

    - by anita
    How do you have an object slide up as if it were hidden behind something, rather than bending out. example In the jsfiddle demo, you can see the circle bends flat as it slides, but I'd like it to slide out as if it were hidden behind something. (I unfortunately can't just put an image or div with the same background color over the circle and have the circle underneath slide upward.) html <div class="button">Hover</div> <div class="box"> Sliding down! </div> jquery $('.box').hide(); $('.button').hover( function() { $('.box').slideToggle('slow'); } ); update: You guys had really good answers! But I found one of the solutions: http://jsfiddle.net/7fNbM/36/ I decided to just wrap the .button div and .box div in a container, and give the container a specific height, specific width, and overflow of hidden. This way I wouldn't have to cover the image in the background and it provides the effect I was looking for.

    Read the article

  • 8 Things You Can Do In Android’s Developer Options

    - by Chris Hoffman
    The Developer Options menu in Android is a hidden menu with a variety of advanced options. These options are intended for developers, but many of them will be interesting to geeks. You’ll have to perform a secret handshake to enable the Developer Options menu in the Settings screen, as it’s hidden from Android users by default. Follow the simple steps to quickly enable Developer Options. Enable USB Debugging “USB debugging” sounds like an option only an Android developer would need, but it’s probably the most widely used hidden option in Android. USB debugging allows applications on your computer to interface with your Android phone over the USB connection. This is required for a variety of advanced tricks, including rooting an Android phone, unlocking it, installing a custom ROM, or even using a desktop program that captures screenshots of your Android device’s screen. You can also use ADB commands to push and pull files between your device and your computer or create and restore complete local backups of your Android device without rooting. USB debugging can be a security concern, as it gives computers you plug your device into access to your phone. You could plug your device into a malicious USB charging port, which would try to compromise you. That’s why Android forces you to agree to a prompt every time you plug your device into a new computer with USB debugging enabled. Set a Desktop Backup Password If you use the above ADB trick to create local backups of your Android device over USB, you can protect them with a password with the Set a desktop backup password option here. This password encrypts your backups to secure them, so you won’t be able to access them if you forget the password. Disable or Speed Up Animations When you move between apps and screens in Android, you’re spending some of that time looking at animations and waiting for them to go away. You can disable these animations entirely by changing the Window animation scale, Transition animation scale, and Animator duration scale options here. If you like animations but just wish they were faster, you can speed them up. On a fast phone or tablet, this can make switching between apps nearly instant. If you thought your Android phone was speedy before, just try disabling animations and you’ll be surprised how much faster it can seem. Force-Enable FXAA For OpenGL Games If you have a high-end phone or tablet with great graphics performance and you play 3D games on it, there’s a way to make those games look even better. Just go to the Developer Options screen and enable the Force 4x MSAA option. This will force Android to use 4x multisample anti-aliasing in OpenGL ES 2.0 games and other apps. This requires more graphics power and will probably drain your battery a bit faster, but it will improve image quality in some games. This is a bit like force-enabling antialiasing using the NVIDIA Control Panel on a Windows gaming PC. See How Bad Task Killers Are We’ve written before about how task killers are worse than useless on Android. If you use a task killer, you’re just slowing down your system by throwing out cached data and forcing Android to load apps from system storage whenever you open them again. Don’t believe us? Enable the Don’t keep activities option on the Developer options screen and Android will force-close every app you use as soon as you exit it. Enable this app and use your phone normally for a few minutes — you’ll see just how harmful throwing out all that cached data is and how much it will slow down your phone. Don’t actually use this option unless you want to see how bad it is! It will make your phone perform much more slowly — there’s a reason Google has hidden these options away from average users who might accidentally change them. Fake Your GPS Location The Allow mock locations option allows you to set fake GPS locations, tricking Android into thinking you’re at a location where you actually aren’t. Use this option along with an app like Fake GPS location and you can trick your Android device and the apps running on it into thinking you’re at locations where you actually aren’t. How would this be useful? Well, you could fake a GPS check-in at a location without actually going there or confuse your friends in a location-tracking app by seemingly teleporting around the world. Stay Awake While Charging You can use Android’s Daydream Mode to display certain apps while charging your device. If you want to force Android to display a standard Android app that hasn’t been designed for Daydream Mode, you can enable the Stay awake option here. Android will keep your device’s screen on while charging and won’t turn it off. It’s like Daydream Mode, but can support any app and allows users to interact with them. Show Always-On-Top CPU Usage You can view CPU usage data by toggling the Show CPU usage option to On. This information will appear on top of whatever app you’re using. If you’re a Linux user, the three numbers on top probably look familiar — they represent the system load average. From left to right, the numbers represent your system load over the last one, five, and fifteen minutes. This isn’t the kind of thing you’d want enabled most of the time, but it can save you from having to install third-party floating CPU apps if you want to see CPU usage information for some reason. Most of the other options here will only be useful to developers debugging their Android apps. You shouldn’t start changing options you don’t understand. If you want to undo any of these changes, you can quickly erase all your custom options by sliding the switch at the top of the screen to Off.     

    Read the article

  • Friction not working for Vehicle in BulletPhysics

    - by Manmohan Bishnoi
    I am creating a vehicle using bullet-physics engine (v 2.82). I created a ground ( btBoxShape ), a box and a vehicle (following the demo). But friction between ground and vehicle wheels seems not working. As soon as the vehicle is placed in 3d world, it starts moving forward. START : Steering works for the vehicle, but engineForce and brakingForce does not work (i.e. I cannot speed-up or stop the vehicle) : I create physics world like this : void initPhysics() { broadphase = new btDbvtBroadphase(); collisionConfiguration = new btDefaultCollisionConfiguration(); dispatcher = new btCollisionDispatcher(collisionConfiguration); solver = new btSequentialImpulseConstraintSolver(); dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration); dynamicsWorld->setGravity(btVector3(0, -9.81, 0)); // Debug Drawer bulletDebugugger.setDebugMode(btIDebugDraw::DBG_DrawWireframe); dynamicsWorld->setDebugDrawer(&bulletDebugugger); //groundShape = new btStaticPlaneShape(btVector3(0, 1, 0), 1); groundShape = new btBoxShape(btVector3(50, 3, 50)); fallShape = new btBoxShape(btVector3(1, 1, 1)); // Orientation and Position of Ground groundMotionState = new btDefaultMotionState(btTransform(btQuaternion(0, 0, 0, 1), btVector3(0, -3, 0))); btRigidBody::btRigidBodyConstructionInfo groundRigidBodyCI(0, groundMotionState, groundShape, btVector3(0, 0, 0)); groundRigidBody = new btRigidBody(groundRigidBodyCI); dynamicsWorld->addRigidBody(groundRigidBody); /////////////////////////////////////////////////////////////////////// // Vehicle Setup /////////////////////////////////////////////////////////////////////// vehicleChassisShape = new btBoxShape(btVector3(1.f, 0.5f, 2.f)); vehicleBody = new btCompoundShape(); localTrans.setIdentity(); localTrans.setOrigin(btVector3(0, 1, 0)); vehicleBody->addChildShape(localTrans, vehicleChassisShape); localTrans.setOrigin(btVector3(3, 0.f, 0)); vehicleMotionState = new btDefaultMotionState(localTrans); //vehicleMotionState = new btDefaultMotionState(btTransform(btQuaternion(0, 0, 0, 1), btVector3(3, 0, 0))); btVector3 vehicleInertia(0, 0, 0); vehicleBody->calculateLocalInertia(vehicleMass, vehicleInertia); btRigidBody::btRigidBodyConstructionInfo vehicleRigidBodyCI(vehicleMass, vehicleMotionState, vehicleBody, vehicleInertia); vehicleRigidBody = new btRigidBody(vehicleRigidBodyCI); dynamicsWorld->addRigidBody(vehicleRigidBody); wheelShape = new btCylinderShapeX(btVector3(wheelWidth, wheelRadius, wheelRadius)); { vehicleRayCaster = new btDefaultVehicleRaycaster(dynamicsWorld); vehicle = new btRaycastVehicle(vehicleTuning, vehicleRigidBody, vehicleRayCaster); // never deactivate vehicle vehicleRigidBody->setActivationState(DISABLE_DEACTIVATION); dynamicsWorld->addVehicle(vehicle); float connectionHeight = 1.2f; bool isFrontWheel = true; vehicle->setCoordinateSystem(rightIndex, upIndex, forwardIndex); // 0, 1, 2 // add wheels // front left btVector3 connectionPointCS0(CUBE_HALF_EXTENT-(0.3*wheelWidth), connectionHeight, 2*CUBE_HALF_EXTENT-wheelRadius); vehicle->addWheel(connectionPointCS0, wheelDirectionCS0, wheelAxleCS, suspensionRestLength, wheelRadius, vehicleTuning, isFrontWheel); // front right connectionPointCS0 = btVector3(-CUBE_HALF_EXTENT+(0.3*wheelWidth), connectionHeight, 2*CUBE_HALF_EXTENT-wheelRadius); vehicle->addWheel(connectionPointCS0, wheelDirectionCS0, wheelAxleCS, suspensionRestLength, wheelRadius, vehicleTuning, isFrontWheel); isFrontWheel = false; // rear right connectionPointCS0 = btVector3(-CUBE_HALF_EXTENT+(0.3*wheelWidth), connectionHeight, -2*CUBE_HALF_EXTENT+wheelRadius); vehicle->addWheel(connectionPointCS0, wheelDirectionCS0, wheelAxleCS, suspensionRestLength, wheelRadius, vehicleTuning, isFrontWheel); // rear left connectionPointCS0 = btVector3(CUBE_HALF_EXTENT-(0.3*wheelWidth), connectionHeight, -2*CUBE_HALF_EXTENT+wheelRadius); vehicle->addWheel(connectionPointCS0, wheelDirectionCS0, wheelAxleCS, suspensionRestLength, wheelRadius, vehicleTuning, isFrontWheel); for (int i = 0; i < vehicle->getNumWheels(); i++) { btWheelInfo& wheel = vehicle->getWheelInfo(i); wheel.m_suspensionStiffness = suspensionStiffness; wheel.m_wheelsDampingRelaxation = suspensionDamping; wheel.m_wheelsDampingCompression = suspensionCompression; wheel.m_frictionSlip = wheelFriction; wheel.m_rollInfluence = rollInfluence; } } /////////////////////////////////////////////////////////////////////// // Orientation and Position of Falling body fallMotionState = new btDefaultMotionState(btTransform(btQuaternion(0, 0, 0, 1), btVector3(-1, 5, 0))); btScalar mass = 1; btVector3 fallInertia(0, 0, 0); fallShape->calculateLocalInertia(mass, fallInertia); btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(mass, fallMotionState, fallShape, fallInertia); fallRigidBody = new btRigidBody(fallRigidBodyCI); dynamicsWorld->addRigidBody(fallRigidBody); } I step physics world like this : // does not work vehicle->applyEngineForce(maxEngineForce, WHEEL_REARLEFT); vehicle->applyEngineForce(maxEngineForce, WHEEL_REARRIGHT); // these also do not work vehicle->setBrake(gBreakingForce, WHEEL_REARLEFT); vehicle->setBrake(gBreakingForce, WHEEL_REARRIGHT); // this works vehicle->setSteeringValue(gVehicleSteering, WHEEL_FRONTLEFT); vehicle->setSteeringValue(gVehicleSteering, WHEEL_FRONTRIGHT); dynamicsWorld->stepSimulation(1 / 60.0f, 10); However If I apply brakingForce to all 4 wheels (i.e. including WHEEL_FRONTLEFT and WHEEL_FRONTRIGHT), then my vehicle stops, but keeps sliding/moving forward very very slowly. How do I fix this ?

    Read the article

  • Determining the angle to fire a shot when target and shooter moves, and bullet moves with shooter velocity added in

    - by Azaral
    I saw this question: Predicting enemy position in order to have an object lead its target and followed the link in the answer to stack overflow. In the stack overflow page I used the 2nd answer, the one that is a large mathematical derivation. My situation is a little different though. My first question though is will the answer provided in the stack overflow page even work to begin with, assuming the original circumstances of moving target and stationary shooter. My situation is a little different than that situation. My target moves, the shooter moves, and the bullets from the shooter start off with the velocities in x and y added to the bullets' x and y velocities. If you are sliding to the right, the bullets will remain in front of you as you move so as long as your velocity remains constant. What I'm trying to do is to get the enemy to be able to determine where they need to shoot in order to hit the player. Unless the player and enemy is stationary, the velocity from the ship adding to the velocity of the bullets will cause a miss. I'd rather like to prevent that. I used the formula in the stack overflow answer and did what I thought were the appropriate adjustments. I've been banging at this for the last four hours and I just can't make it click. It is probably something really simple and boneheaded that I am missing (that seems to be a lot of my problems lately). Here is the solution presented from the stack overflow answer: It boils down to solving a quadratic equation of the form: a * sqr(x) + b * x + c == 0 Note that by sqr I mean square, as opposed to square root. Use the following values: a := sqr(target.velocityX) + sqr(target.velocityY) - sqr(projectile_speed) b := 2 * (target.velocityX * (target.startX - cannon.X) + target.velocityY * (target.startY - cannon.Y)) c := sqr(target.startX - cannon.X) + sqr(target.startY - cannon.Y) Now we can look at the discriminant to determine if we have a possible solution. disc := sqr(b) - 4 * a * c If the discriminant is less than 0, forget about hitting your target -- your projectile can never get there in time. Otherwise, look at two candidate solutions: t1 := (-b + sqrt(disc)) / (2 * a) t2 := (-b - sqrt(disc)) / (2 * a) Note that if disc == 0 then t1 and t2 are equal. If there are no other considerations such as intervening obstacles, simply choose the smaller positive value. (Negative t values would require firing backward in time to use!) Substitute the chosen t value back into the target's position equations to get the coordinates of the leading point you should be aiming at: aim.X := t * target.velocityX + target.startX aim.Y := t * target.velocityY + target.startY Here is my code, after being corrected by Sam Hocevar (thank you again for your help!). It still doesn't work. For some reason it never enters the section of code inside the if(disc = 0) (obviously because it is always less than zero but...). However, if I plug the numbers from my game log on the enemy and player positions and velocities it outputs a valid firing solution. I have looked at the code side by side a couple of times now and I can't find any differences. There has got to be something simple I'm missing here. If someone else could look at this code and determine what is going on here I'd appreciate it. I know it's not going through that section because if it were, shouldShoot would become true and the enemy would be blasting away at the player. This section calls the function in question, CalculateShootHeading() if(shouldMove) { UseEngines(); } x += xVelocity; y += yVelocity; CalculateShootHeading(); if(shouldShoot) { ShootWeapons(); } UpdateWeapons(); This is CalculateShootHeading(). This is inside the enemy class so x and y are the enemy's x and y and the same with velocity. One output from my game log gives Player X = 2108, Player Y = -180.956, Player X velocity = 10.9949, Player Y Velocity = -6.26017, Enemy X = 1988.31, Enemy Y = -339.051, Enemy X velocity = 1.81666, Enemy Y velocity = -9.67762, 0 enemy projectiles. The output from the console tester is Bullet position = 2210.49, -239.313 and Player Position = 2210.49, -239.313. This doesn't make any sense. The only thing that could be different is the code or the input into my function in the game and I've checked that and I don't think that it is wrong as it's updated before this and never changed. float const bulletSpeed = 30.f; float const dx = playerX - x; float const dy = playerY - y; float const vx = playerXVelocity - xVelocity; float const vy = playerYVelocity - yVelocity; float const a = vx * vx + vy * vy - bulletSpeed * bulletSpeed; float const b = 2.f * (vx * dx + vy * dy); float const c = dx * dx + dy * dy; float const disc = b * b - 4.f * a * c; shouldShoot = false; if (disc >= 0.f) { float t0 = (-b - std::sqrt(disc)) / (2.f * a); float t1 = (-b + std::sqrt(disc)) / (2.f * a); if (t0 < 0.f || (t1 < t0 && t1 >= 0.f)) { t0 = t1; } if (t0 >= 0.f) { float shootx = vx + dx / t0; float shooty = vy + dy / t0; heading = std::atan2(shooty, shootx) * RAD2DEGREE; } shouldShoot = true; }

    Read the article

  • UIViewAnimation done by a UIViewController belonging to a UINavigationController?

    - by RickiG
    Hi I have an UINavigationController which the user navigates with. When pushing a specific UIViewController onto the navigation stack, a "settings" button appear in the navigationBar. When the user clicks this button I would like to flip the current view/controller, i.e. everything on screen, including the navigationBar, over to a settings view. So I have a SettingsViewController which I would like to flip to from my CurrentViewController that lives on a navigationController stack. I get all kinds of strange behavior trying to do this, the UIViews belonging to the SettingsViewController will start to animate, sliding into place, the navigationButtons moves around, nothing acts as I would think. -(void)settingsHandler { SettingViewController *settingsView = [[SettingViewController alloc] init]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:YES]; [self.navigationController.view addSubview:settingsView.view]; [UIView commitAnimations]; } The above results in the views flipping correctly, but the subviews of the SettingsViewController are all positioned in (0, 0) and after the transition, they 'snap' into place? Is it because I instantiate and add my subviews in viewDidLoad, like this? - (void)viewDidLoad { UIImageView *imageBg = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 460.0f)]; [imageBg setImage:[UIImage imageNamed:@"background.png"]]; [self.view addSubview:imageBg]; [imageBg release]; SettingsSubview *switchView = [[SettingsSubview alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 460.0f)]; [self.view addSubview:switchView]; [switchView release]; [super viewDidLoad]; } 1: How should I correctly do the "flip" transition, from within the UIViewController in the UINavigationController, to a new UIViewController and subsequently from the new UIViewController and back to the "original" UIViewController residing on the UINavigationControllers stack? 2: Should I use a different approach, than the "viewDidLoad" method, when instantiating and adding subviews to a UIViewController? -question 2 is more of a "best practice" thing. I have seen different ways of doing it and I am having trouble either finding or understanding the life-cycle documentation and the different threads and posts on the subject. I am missing the "best practice" examples. Thank You very much for any help given:)

    Read the article

  • Jquery Cycle issue or css issue in Chrome/Safari for Mac

    - by Mark
    Hi i have used the jquery cycle plugin to create multiple simple sliding galleries. In Chrome/Safair on Mac the browser is not loading the images. Here is the link the js i am using is here, although it could be a css issue..? I am struggling to find the real problem. $(document).ready(function() { $('.slides').each(function() { var $this = $(this), $ss = $this.closest('.slideshow'); var prev = $ss.find('a.prev'), next = $ss.find('a.next'); $this.cycle({ prev: prev, next: next, fx: 'scrollLeft', speed: 'fast', timeout: 0 }); }); }); CSS .slideshow { width:476px; height:287px; float:left; margin-right:30px; position:relative; z-index:0; margin-bottom:20px; } .slides { position:absolute; top:0; left:0; z-index:1; } a.prev { display:block; width:23px; height:22px; background:red; position:absolute; z-index:1000; background: url(../images/next_prev.png) no-repeat 0 0; top:133px; left:-11px; } a.next { display:block; width:23px; height:22px; background:red; position:absolute; z-index:1000; background: url(../images/next_prev.png) no-repeat -23px 0; top:133px; right:-11px; } Markup: <div class="slideshow"> <div class="slides"> <img src="images/chief_st_1.jpg" alt="CHIEF stationery + literature" /> <img src="images/chief_st_3.jpg" alt="CHIEF stationery + literature" /> <img src="images/chief_st_2.jpg" alt="CHIEF stationery + literature" /> </div> <a class="prev" href="#"></a> <a class="next" href="#"></a> </div> Any help would be appreciated. thanks

    Read the article

< Previous Page | 7 8 9 10 11 12 13  | Next Page >