Search Results

Search found 3801 results on 153 pages for 'container'.

Page 29/153 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • scroll bar important query???

    - by rajesh
    Hello all, actually i downloaded code for scroll from....... http://sorgalla.com/jcarousel/ but when i added it in my page and add using code ... function addElement(url,imagePath){ alert(url); alert(imagePath); var container = document.getElementById('sncs'); items = container.getElementsByTagName("li"); //alert(items.length); var new_element = document.createElement('li'); new_element.innerHTML =""; //var raj='1'+new_element.innerHTML; //alert() new_element.className="jcarousel-item jcarousel-item-horizontal jcarousel-item-4 jcarousel-item-4-horizontal"; //container.insertBefore(new_element, container.firstChild); container.appendChild( new_element ); } it added li not at the end but below scroll what will be the problem..... Please help me to sort out this problem....

    Read the article

  • Why is the base class being called?

    - by oneBelizean
    I'm new to c# so bare with me. But here's my situation. interface Icontainer{ string name(); } abstract class fuzzyContainer : Icontainer{ string name(){ return "Fuzzy Container"; } } class specialContainer: fuzzyContainer{ string name(){ return base.name() + " Special Container"; } } Icontainer cont = new SpecialContainer(); cont.name(); // I expected "Fuzzy Container Special Container" as the output. When I run my code as described above the output is simply "Fuzzy Container". What am i missing here? Is there a better way to get the desired results?

    Read the article

  • Castle windsor registration

    - by nivlam
    interface IUserService class LocalUserService : IUserService class RemoteUserService : IUserService interface IUserRepository class UserRepository : IUserRepository If I have the following interfaces and classes, where the IUserService classes have a dependency on IUserRepository. I can register these components by doing something like: container.AddComponent("LocalUserService", typeof(IUserService), typeof(LocalUserService)); container.AddComponent("RemoteUserService", typeof(IUserService), typeof(RemoteUserService)); container.AddComponent("UserRepository", typeof(IUserRepository), typeof(UserRepository)); ... and get the service I want by calling: IUserService userService = container.Resolve<IUserService>("RemoteUserService"); However, if I have the following interfaces and classes: interface IUserService class UserService : IUserService interface IUserRepository class WebUserRepository : IUserRepository class LocalUserRepository : IUserRepository class DBUserRepository : IUserRepository How do I register these components so that the IUserService component can "choose" which repository to inject at runtime? My idea is to allow the user to choose which repository to query from by providing 3 radio buttons (or whatever) and ask the container to resolve a new IUserService each time.

    Read the article

  • MVC, how view should be accessed from controller?

    - by Kirzilla
    Hello, I'm just learning MVC so you could find my question rather strange... My Controller have access to different shared objects through Container object passed to Controller's constructor. To access shared objects I should do $this-container-db to access Database adapter or $this-container-memcache to access Memcached adapter. I want to know should I put View object into Container with shared objects or no? From one side it is really comfortable to take view from this container, but this way I couldn't create multiple Views instances (for example, every time I'm calling Controller's method from View I should have one more View instance). What is the solution? How should I pass View object into Controller and/or how should I create new View instances from Controller? Thank you!

    Read the article

  • C++ constant reference lifetime

    - by aaa
    hello I have code that looks like this: class T {}; class container { const T &first, T &second; container(const T&first, const T & second); }; class adapter : T {}; container(adapter(), adapter()); I thought lifetime of constant reference would be lifetime of container. However, it appears otherwise, adapter object is destroyed after container is created, leading dangling reference. What is the correct lifetime? how to correctly implement binding temporary object to class member reference? Thanks

    Read the article

  • Identical CSS behaves differently when applied to either body or a div

    - by Razor
    Using a DIV as container <div class="container"> <div class="half-hidden"></div> </div> CSS .container { margin: 20px auto 0; width: 200px; height: 200px; border: 1px solid red; position: relative; overflow: hidden; } .half-hidden { position: absolute; top: 10px; bottom: 10px; left: -50px; width: 100px; border: 1px solid teal; } Using body as container <div class="half-hidden"></div> CSS Replace the above .container with body Why?

    Read the article

  • Java Swing - How to access a JComponent of one JPanel from other JPanel, both added to the JFrame?

    - by Yatendra Goel
    I am developing a Java Desktop Application with GUI implemented in SWING. I hava a JFrame. I have added three JPanels on that. One JPanel panel1 has a Start Button. Now I want to disable various componets on other JPanels when a user presses the start button on the panel1. Now how can I access the components of those other panels from panel1. I know that one approach is to first get the container of panel1 panel1.getParent(); Then get the components of the container container.getComponents(); and use them as per need. Q1. Is there any other way by which I can perform the same task? (I think this is the only way) Q2. After getting the components list of the container, how to differentiate one container with other?

    Read the article

  • slideIn and slideOut reduces width of component

    - by shub
    Can someone help me to solve the problem of reducing the width of the component during SlideIn or SlideOut? I am using the Ext JS version 4.1 RC1. Ext.onReady(function () { Ext.create('Ext.container.Viewport', { layout: 'border', items: [{ region: 'north', autoHeight: true, border: false, margins: '0 0 5 0', items: [{ xtype: 'container', id: 'con_notification-box', cls: 'notification-box', hidden: true, border: true, width: 500, height: 0, style: { position: 'fixed', minHeight: '75px !important', left: '50%', marginLeft: '-250px', zIndex: '999999', backgroundColor: 'white' }, items:[{ xtype: 'container', html: '<p>Insert your information text here.</p>' },{ xtype: 'container', id: 'con_application-close', cls: 'notification-close', html: '<br />Close' }] },{ xtype: 'container', html: '<h1 class="x-panel-header">Your title</h1>' }] }] }); var con_notification_box = Ext.getCmp('con_notification-box').getEl(); con_notification_box.slideIn('t', { easing: 'easeOut', duration: 500 }); Ext.getCmp('con_application-close').getEl().on('click',function(){ con_notification_box.slideOut('t', { duration: 2000 }); }); }); I'd be very grateful if you could help me. Kind regards, shub

    Read the article

  • Setting height of a DIV to correspond with location of anchor inside said DIV

    - by filip
    Core issue : http://jsfiddle.net/pipip/P46Xg/ I have a div container with a few paragraphs of text, and inside one of these paragraphs is the following anchor <a id="stop" /> The container is set to overflow:hidden Is it possible with javascript / JQuery to set the height of the container so that the bottom of the container stops exactly at or below the anchor? Added Depth & Background : http://jsfiddle.net/pipip/yj9dB/ This would be used for a modified JQuery Slider. Where someone using a CMS could type [readmore] anywhere into the Content field, which would be replaced by the above anchor via PHP. This way they would be easily able to control where the Read More break appears within the container. In the associated example I am hard-coding the height to 75px, although what I want is for the height to be dependent on the location of the anchor id="stop" in the text. Thanks. If this is an awful way to go about it, I'm all ears!

    Read the article

  • Backbone.js Adding Model to Collection Issue

    - by jtmgdevelopment
    I am building a test application in Backbone.js (my first app using Backbone). The app goes like this: Load Data from server "Plans" Build list of plans and show to screen There is a button to add a new plan Once new plan is added, add to collection ( do not save to server as of now ) redirect to index page and show the new collection ( includes the plan you just added) My issue is with item 5. When I save a plan, I add the model to the collection then redirect to the initial view. At this point, I fetch data from the server. When I fetch data from the server, this overwrites my collection and my added model is gone. How can I prevent this from happening? I have found a way to do this but it is definitely not the correct way at all. Below you will find my code examples for this. Thanks for the help. PlansListView View: var PlansListView = Backbone.View.extend({ tagName : 'ul', initialize : function() { _.bindAll( this, 'render', 'close' ); //reset the view if the collection is reset this.collection.bind( 'reset', this.render , this ); }, render : function() { _.each( this.collection.models, function( plan ){ $( this.el ).append( new PlansListItemView({ model: plan }).render().el ); }, this ); return this; }, close : function() { $( this.el ).unbind(); $( this.el ).remove(); } });//end NewPlanView Save Method var NewPlanView = Backbone.View.extend({ tagName : 'section', template : _.template( $( '#plan-form-template' ).html() ), events : { 'click button.save' : 'savePlan', 'click button.cancel' : 'cancel' }, intialize: function() { _.bindAll( this, 'render', 'save', 'cancel' ); }, render : function() { $( '#container' ).append( $( this.el ).html(this.template( this.model.toJSON() )) ); return this; }, savePlan : function( event ) { this.model.set({ name : 'bad plan', date : 'friday', desc : 'blah', id : Math.floor(Math.random()*11), total_stops : '2' }); this.collection.add( this.model ); app.navigate('', true ); event.preventDefault(); }, cancel : function(){} }); Router (default method): index : function() { this.container.empty(); var self = this; //This is a hack to get this to work //on default page load fetch all plans from the server //if the page has loaded ( this.plans is defined) set the updated plans collection to the view //There has to be a better way!! if( ! this.plans ) { this.plans = new Plans(); this.plans.fetch({ success: function() { self.plansListView = new PlansListView({ collection : self.plans }); $( '#container' ).append( self.plansListView.render().el ); if( self.requestedID ) self.planDetails( self.requestedID ); } }); } else { this.plansListView = new PlansListView({ collection : this.plans }); $( '#container' ).append( self.plansListView.render().el ); if( this.requestedID ) self.planDetails( this.requestedID ); } }, New Plan Route: newPlan : function() { var plan = new Plan({name: 'Cool Plan', date: 'Monday', desc: 'This is a great app'}); this.newPlan = new NewPlanView({ model : plan, collection: this.plans }); this.newPlan.render(); } FULL CODE ( function( $ ){ var Plan = Backbone.Model.extend({ defaults: { name : '', date : '', desc : '' } }); var Plans = Backbone.Collection.extend({ model : Plan, url : '/data/' }); $( document ).ready(function( e ){ var PlansListView = Backbone.View.extend({ tagName : 'ul', initialize : function() { _.bindAll( this, 'render', 'close' ); //reset the view if the collection is reset this.collection.bind( 'reset', this.render , this ); }, render : function() { _.each( this.collection.models, function( plan ){ $( this.el ).append( new PlansListItemView({ model: plan }).render().el ); }, this ); return this; }, close : function() { $( this.el ).unbind(); $( this.el ).remove(); } });//end var PlansListItemView = Backbone.View.extend({ tagName : 'li', template : _.template( $( '#list-item-template' ).html() ), events :{ 'click a' : 'listInfo' }, render : function() { $( this.el ).html( this.template( this.model.toJSON() ) ); return this; }, listInfo : function( event ) { } });//end var PlanView = Backbone.View.extend({ tagName : 'section', events : { 'click button.add-plan' : 'newPlan' }, template: _.template( $( '#plan-template' ).html() ), initialize: function() { _.bindAll( this, 'render', 'close', 'newPlan' ); }, render : function() { $( '#container' ).append( $( this.el ).html( this.template( this.model.toJSON() ) ) ); return this; }, newPlan : function( event ) { app.navigate( 'newplan', true ); }, close : function() { $( this.el ).unbind(); $( this.el ).remove(); } });//end var NewPlanView = Backbone.View.extend({ tagName : 'section', template : _.template( $( '#plan-form-template' ).html() ), events : { 'click button.save' : 'savePlan', 'click button.cancel' : 'cancel' }, intialize: function() { _.bindAll( this, 'render', 'save', 'cancel' ); }, render : function() { $( '#container' ).append( $( this.el ).html(this.template( this.model.toJSON() )) ); return this; }, savePlan : function( event ) { this.model.set({ name : 'bad plan', date : 'friday', desc : 'blah', id : Math.floor(Math.random()*11), total_stops : '2' }); this.collection.add( this.model ); app.navigate('', true ); event.preventDefault(); }, cancel : function(){} }); var AppRouter = Backbone.Router.extend({ container : $( '#container' ), routes : { '' : 'index', 'viewplan/:id' : 'planDetails', 'newplan' : 'newPlan' }, initialize: function(){ }, index : function() { this.container.empty(); var self = this; //This is a hack to get this to work //on default page load fetch all plans from the server //if the page has loaded ( this.plans is defined) set the updated plans collection to the view //There has to be a better way!! if( ! this.plans ) { this.plans = new Plans(); this.plans.fetch({ success: function() { self.plansListView = new PlansListView({ collection : self.plans }); $( '#container' ).append( self.plansListView.render().el ); if( self.requestedID ) self.planDetails( self.requestedID ); } }); } else { this.plansListView = new PlansListView({ collection : this.plans }); $( '#container' ).append( self.plansListView.render().el ); if( this.requestedID ) self.planDetails( this.requestedID ); } }, planDetails : function( id ) { if( this.plans ) { this.plansListView.close(); this.plan = this.plans.get( id ); if( this.planView ) this.planView.close(); this.planView = new PlanView({ model : this.plan }); this.planView.render(); } else{ this.requestedID = id; this.index(); } if( ! this.plans ) this.index(); }, newPlan : function() { var plan = new Plan({name: 'Cool Plan', date: 'Monday', desc: 'This is a great app'}); this.newPlan = new NewPlanView({ model : plan, collection: this.plans }); this.newPlan.render(); } }); var app = new AppRouter(); Backbone.history.start(); }); })( jQuery );

    Read the article

  • How to Authenticate to Active Directory Services (ADs) using .NET 3.5 / C#

    - by Ranger Pretzel
    After much struggling, I've figured out how to authenticate to my company's Active Directory using just 2 lines of code with the Domain, Username, and Password in .NET 2.0 (in C#): // set domain, username, password, and security parameters DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain, username, password, AuthenticationTypes.Secure | AuthenticationTypes.SecureSocketsLayer); // force Bind to AD server to authenticate object obj = entry.NativeObject; If the 2nd line throws an exception, then the credentials and/or parameters were bad. (Specific reason can be found in the exception.) If no exception, then the credentials are good. Trying to do this in .NET 3.5 looks like it should be easy, but has me at a roadblock instead. Specifically, I've been working with this example: PrincipalContext domainContext = new PrincipalContext(ContextType.Domain, domain); using (domainContext) { return domainContext.ValidateCredentials(UserName, Password); } Unfortunately, this doesn't work for me as I don't have both ContextOptions set to Sealed/Secure and SSL (like I did above in the .NET 2.0 code.) There is an alternate constructor for PrincipalContext that allows setting the ContextOptions, but this also requires supplying a Distinguished Name (DN) of a Container Object and I don't know exactly what mine is or how I would find out. public PrincipalContext(ContextType contextType, string name, string container, ContextOptions options); // container: // The container on the store to use as the root of the context. All queries // are performed under this root, and all inserts are performed into this container. // For System.DirectoryServices.AccountManagement.ContextType.Domain and System.DirectoryServices.AccountManagement.ContextType.ApplicationDirectory // context types, this parameter is the distinguished name of a container object. Any suggestions?

    Read the article

  • jQuery datepicker returns "inst is null" error when loaded via AJAX

    - by Robert
    I'm loading content via an AJAX call into a table row added to the DOM on the fly. I'm calling the datepicker functionality in my callback function and the calendar shows fine. However, when I click on the date, I get an error: inst is null. Here's my code: $(document).ready(function() { $(".edit").live("click", function() { //Delete previously loaded edit row $("#tempEditRow").remove(); //Get the record id of the row to be edited var recordID = $(this).parent("td").parent("tr").attr("id"); //Add the new row to the document $(this).parent("td").parent("tr").after("<tr id=\"tempEditRow\"><td id=\"tempEditCell\" colspan=\"100\"></td></tr>") //Get a reference to the new row var container = $("#tempEditCell"); //Populate the container populateContainer("/wpm/includes/ajax_editApplication.cfm?id=" + recordID, container); }); }); function populateContainer(ajaxUrl, container) { //Populate the container $.ajax({ url: ajaxUrl, cache: false, success: function(html){ $(container).html(html); $('.datepicker').datepicker(); } }); } I've tried deleting the hasDatepicker class, deleting any references to the datepicker, etc. but nothing is working. Thanks in advance for helping!

    Read the article

  • WCF and Unity - Dependecy Injection

    - by Michael
    I'm trying to hock up WCF with dependecy injection. All the examples that I have found is based on the assumptions that you either uses a .svc (ServiceHostFactory) service or uses app.config to configure the container. Other examples is also based on that the container is passed around to the classes. I would like a solution where the container is not passed around (not tightly coupled to Unity). Where I don't uses a config file to configure the container and where I use self-hosted services. The problem is - as I see it - that the ServiceHost is taking the type of the service implementation as a parameter so what different does it do to use the InstanceProvider? The solution I have come up with at the moment is to register the ServiceHost (or a specialization) an register a Type with a name ( e.g. container.RegisterInstance<Type>("ServiceName", typeof(Service);). And then container.RegisterType<UnityServiceHost>(new InjectionConstructor(new ResolvedParameter<Type>("ServiceName"))); to register the ServiceHost. Any better solutions out there? I'm I perhaps way of in my assumptions. Best regards, Michael

    Read the article

  • Finding distance to the closest point in a point cloud on an uniform grid

    - by erik
    I have a 3D grid of size AxBxC with equal distance, d, between the points in the grid. Given a number of points, what is the best way of finding the distance to the closest point for each grid point (Every grid point should contain the distance to the closest point in the point cloud) given the assumptions below? Assume that A, B and C are quite big in relation to d, giving a grid of maybe 500x500x500 and that there will be around 1 million points. Also assume that if the distance to the nearest point exceds a distance of D, we do not care about the nearest point distance, and it can safely be set to some large number (D is maybe 2 to 10 times d) Since there will be a great number of grid points and points to search from, a simple exhaustive: for each grid point: for each point: if distance between points < minDistance: minDistance = distance between points is not a good alternative. I was thinking of doing something along the lines of: create a container of size A*B*C where each element holds a container of points for each point: define indexX = round((point position x - grid min position x)/d) // same for y and z add the point to the correct index of the container for each grid point: search the container of that grid point and find the closest point if no points in container and D > 0.5d: search the 26 container indices nearest to the grid point for a closest point .. continue with next layer until a point is found or the distance to that layer is greater than D Basically: put the points in buckets and do a radial search outwards until a points is found for each grid point. Is this a good way of solving the problem, or are there better/faster ways? A solution which is good for parallelisation is preferred.

    Read the article

  • Converting From Castle Windsor To StructureMap In An MVC2 Project

    - by alphadogg
    I am learning about best practices in MVC2 and I am knocking off a copy of the "Who Can Help Me" project (http://whocanhelpme.codeplex.com/) off Codeplex. In it, they use Castle Windsor for their DI container. One "learning" task I am trying to do is convert this subsystem in this project to use StructureMap. Basically, at Application_Start(), the code news up a Windsor container. Then, it goes through multiple assemblies, using MEF: public static void Register(IContainer container) { var catalog = new CatalogBuilder() .ForAssembly(typeof(IComponentRegistrarMarker).Assembly) .ForMvcAssembly(Assembly.GetExecutingAssembly()) .ForMvcAssembliesInDirectory(HttpRuntime.BinDirectory, "CPOP*.dll") // Won't work in Partial trust .Build(); var compositionContainer = new CompositionContainer(catalog); compositionContainer .GetExports<IComponentRegistrar>() .Each(e => e.Value.Register(container)); } and any class in any assembly that has an IComponentRegistrar interface will get its Register() method run. For example, the controller registrar's Register() method implementation basically is: public void Register(IContainer container) { Assembly.GetAssembly(typeof(ControllersRegistrarMarker)).GetExportedTypes() .Where(IsController) .Each(type => container.AddComponentLifeStyle( type.Name.ToLower(), type, LifestyleType.Transient )); } private static bool IsController(Type type) { return typeof(IController).IsAssignableFrom(type); } Hopefully, I am not butchering WCHM too much. I am wondering how does one do this with StructureMap?

    Read the article

  • ASP.NET MVC Using Castle Windsor IoC

    - by Mad Halfling
    I have an app, modelled on the one from Apress Pro ASP.NET MVC that uses castle windsor's IoC to instantiate the controllers with their respective repositories, and this is working fine e.g. public class ItemController : Controller { private IItemsRepository itemsRepository; public ItemController(IItemsRepository windsorItemsRepository) { this.itemsRepository = windsorItemsRepository; } with using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Castle.Windsor; using Castle.Windsor.Configuration.Interpreters; using Castle.Core.Resource; using System.Reflection; using Castle.Core; namespace WebUI { public class WindsorControllerFactory : DefaultControllerFactory { WindsorContainer container; // The constructor: // 1. Sets up a new IoC container // 2. Registers all components specified in web.config // 3. Registers all controller types as components public WindsorControllerFactory() { // Instantiate a container, taking configuration from web.config container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle"))); // Also register all the controller types as transient var controllerTypes = from t in Assembly.GetExecutingAssembly().GetTypes() where typeof(IController).IsAssignableFrom(t) select t; foreach (Type t in controllerTypes) container.AddComponentWithLifestyle(t.FullName, t, LifestyleType.Transient); } // Constructs the controller instance needed to service each request protected override IController GetControllerInstance(Type controllerType) { return (IController)container.Resolve(controllerType); } } } controlling the controller creation. I sometimes need to create other repository instances within controllers, to pick up data from other places, can I do this using the CW IoC, if so then how? I have been playing around with the creation of new controller classes, as they should auto-register with my existing code (if I can get this working, I can register them properly later) but when I try to instantiate them there is an obvious objection as I can't supply a repos class for the constructor (I was pretty sure that was the wrong way to go about it anyway). Any help (especially examples) would be much appreciated. Cheers MH

    Read the article

  • jQuery - Could use a little help with a content loader

    - by Kenny Bones
    Hi, I'm not very elite when it comes to JavaScript, especially the syntax. So I'm trying to learn. And in this process I'm trying to implement a content loader that basically removes all content from a div and inserts content from another div from a different document. I've tried to do this on this site: www.matkalenderen.no - Check the butt ugly link there. See what happens? I've taken the example from this site: http://nettuts.s3.cdn.plus.org/011_jQuerySite/sample/index.html#index But I'm not sure this example actually works the way I think it does. I mean, if the code just wipes out existing content from a div and inserts content from another div, why does the other webpages in this example include doctype and heading etc etc? Wouldn't you just need the div and it's content? Without all the other stuff "around"? Maybe I don't get how this works though. Thought it worked mosly like include really. This is my code however: $(document).ready(function() { var hash = window.location.hash.substr(1); var href = $('#dynloader a').each(function(){ var href = $(this).attr('href'); if(hash==href.substr(0,href.length-5)){ var toLoad = hash+'.html #container'; $('#container').load(toLoad) } }); $('#dynloader a').click(function(){ var toLoad = $(this).attr('href')+' #container'; $('#container').hide('fast',loadcontainer); $('#load').remove(); $('#wrapper').append('<span id="load">LOADING...</span>'); $('#load').fadeIn('normal'); window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5); function loadcontainer() { $('#container').load(toLoad,'',showNewcontainer()) } function showNewcontainer() { $('#container').show('normal',hideLoader()); } function hideLoader() { $('#load').fadeOut('normal'); } return false; }); });

    Read the article

  • Flex wordwrap issue with multiple text instances

    - by Craig Myles
    Hi, I have a scenario where I want to dynamically add words of text to a container so that it forms a paragraph of text which is wrapped neatly according to the size of the parent container. Each text element will have differing formatting, and will have differing user interaction options. For example, imagine the text " has just spoken out about ". Each word will be added to the container one at a time, at run time. The username in this case would be bold, and if clicked on will trigger an event. Same with the news article. The rest of the text is just plain text which, when clicked on, would do nothing. Now, I'm using Flex 3 so I don't have access to the fancy new text formatting tools. I've implemented a solution where the words are plotted onto a canvas, but this means that the words are wrapped at a particular y position (an arbitrary value I've chosen). When the container is resized, the words still wrap at that position which leaves lots of space. I thought about adding each text element to an Array Collection and using this as a datasource for a Tile List, but Tile Lists don't support variable column widths (in my limited knowledge) so each word would use the same amount of space which isn't ideal. Does anyone know how I can plot words onto a container so that I can retain formatting, events and word wrapping at paragraph level, even if the container is resized?

    Read the article

  • Fading out an article and dropping down a form at the same time?

    - by eveo
    I have an article: <article> Some paragraphs. </article> Below that I have my contact: <div id="contact"> stuff, this form is 600 px tall </div> contact is set to display:none;. I use jQuery to toggle it. What I'm trying to do is modify this script from http://tutsplus.com/lesson/slides-and-structure/ so that it fades out the article text and then slides in the contact form. Having some trouble. Code: <script> (function() { $('html').addClass('js'); var contactForm = { container: $('#contact'), article: $('article'), init: function() { $('<button></button>', { text: 'Contact Me' }) .insertAfter('article:first') .on('click', function() { console.log(this); this.show(); // contactForm.article.fadeToggle(300); // contactForm.container.show(); }) }, show: function() { contactForm.close.call(contactForm.container); contactForm.container.slideToggle(300); }, close: function() { console.log(this); $('<span class=close>X</span>') .prependTo(this) .on('click', function(){ contactForm.article.fadeToggle(300); contactForm.container.slideToggle(300); }) } }; contactForm.init(); })(); </script> The part that is not working is: .on('click', function() { console.log(this); this.show(); // contactForm.article.fadeToggle(300); // contactForm.container.show(); }) When I do .on('click', this.show); it works fine, when I put this.show in a function it does not work!

    Read the article

  • Java Applet - ArrayIndexOutOfBoundsException (pt 2)

    - by Dan
    Hi there, I fixed my previous problem. But now when on my tile map... if I try to go 9 tiles to the RIGHT, and on trying to get to the 9th tile.... I will get this error: Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 8 at tileGen.blocked(tileGen.java:125) at tileGen.keyPressed(tileGen.java:58) at java.awt.Component.processKeyEvent(Component.java:6221) at java.awt.Component.processEvent(Component.java:6040) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676) at java.awt.Component.dispatchEventImpl(Component.java:4502) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Here is code: http://www.so.pastebin.com/hYkpQf13 I have tried many solutions, all of which have failed. Maybe someone here can I help me? Thank you.

    Read the article

  • Magento delete some scripts

    - by Patrik van Dendis
    Hi I use a magento for my e-commerce. I have custom design, but when I show my source code I can see some scripts and css styles after my footer. I want edit it but I dont know where. <!--{%FOOTER_LINK}--> </div> </div> <script type='text/javascript' src='//www.beetailer.com/javascripts/beetailer.js'></script> <style type="text/css"> div.share-buttons {margin-top: 5px; margin-bottom: 2px; height: 28px; vertical-align: middle; text-align: justify} div.share-buttons-fb-like {width: 260px;} div.share-custom-container {width: 260px;} .share-buttons-fb-like .share-custom-container span {width: 260px !important;} iframe.fb_ltr {width: 260px !important;} div.top-container {margin-bottom: 0px; text-align: justify} .header-container .top-container {margin-bottom: 0px; text-align: justify} .header-container {margin-bottom: 0px;} div.share-buttons-og { margin-right: 5px !important;} .og-want {margin-top: 2px !important;} .og-own {margin-top: 2px !important;} </style>

    Read the article

  • Calling function after .load (Jquery)

    - by Matt
    Having a little difficulty getting a function to call after a .load: $(function(){ $('a.pageFetcher').click(function(){ $('#main').load($(this).attr('rel')); }); }); The page loads, but the functions don't fire: $(function(){ var $container = $('#container'); $container.imagesLoaded(function(){ $container.masonry({ itemSelector: '.box', }); }); $container.infinitescroll({ navSelector : '#page-nav', nextSelector : '#page-nav a', itemSelector : '.box', loading: { finishedMsg: 'Nothing else to load.', img: 'http://i.imgur.com/6RMhx.gif' } }, function( newElements ) { $.superbox.settings = { closeTxt: "Close this", loadTxt: "Loading your selection", nextTxt: "Next item", prevTxt: "Previous item" }; $.superbox(); var $newElems = $( newElements ).css({ opacity: 0 }); $newElems.imagesLoaded(function(){ $newElems.animate({ opacity: 1 }); $container.masonry( 'appended', $newElems, true ); }); } ); }); I've attempted to combine them so that the 2nd functions are called after .load (after doing some searching on this site and looking at given answers/examples) but nothing seems to work properly. Suggestions?

    Read the article

  • How to make a custom ear file in maven

    - by Zombies
    Here is my challenge, I need to make an ear file for a specific container. To be more specific on how this ear will be created: This is a standard j2ee ear file, with 1 WAR in it. The container it is deployed to will expect certain xml files (which can easily be found (somewhere) inside the source project). Here are my obstacles The source folder contains various container specific xml files. But, these files do not map directly to where the container expects them inside the EAR file. For example, there will be a file that this container expects to be in 'EARFILE.ear/config/connections.xml'. But this file is located (in the source) at /some/obscure/unrelated/directory. This is the case for about 5-7 files. I cannot change the original source project layout at all. So, how can I create the compliant EAR file that I need. There is NO plugin at this time for the container that I am using, I have certainly looked.

    Read the article

  • Using Generics to return a literal string or from Dictionary<string, object>

    - by Mike
    I think I outsmarted myself this time. Feel free to edit the title also I could not think of a good one. I am reading from a file and then in that file will be a string because its like an xml file. But in the file will be a literal value or a "command" to get the value from the workContainer so <Email>[email protected]</Email> or <Email>[? MyEmail ?]</Email> What I wanted to do instead of writing ifs all over the place to put it in a generic function so logic is If Container command grab from container else grab string and convert to desired type Its up to the user to ensure the file is ok and the type is correct so another example is so <Answer>3</Answer> or <Answer>[? NumberOfSales ?]</Answer> This is the procedure I started to work on public class WorkContainer:Dictionary<string, object> { public T GetKeyValue<T>(string Parameter) { if (Parameter.StartsWith("[? ")) { string key = Parameter.Replace("[? ", "").Replace(" ?]", ""); if (this.ContainsKey(key)) { return (T)this[key]; } else { // may throw error for value types return default(T); } } else { // Does not Compile if (typeof(T) is string) { return Parameter } // OR return (T)Parameter } } } The Call would be mail.To = container.GetKeyValue<string>("[email protected]"); or mail.To = container.GetKeyValue<string>("[? MyEmail ?]"); int answer = container.GetKeyValue<int>("3"); or answer = container.GetKeyValue<int>("[? NumberOfSales ?]"); But it does not compile?

    Read the article

  • Change class of parent div if radio input checked

    - by xxstevenxo
    I've been searching and searching google for answers to my question but have been unsuccessful so far. I'm hoping one of you guys could give me some assistance. I have 10 divs with the class name "dividend" holding a table with the classname/id of "container" then two smaller tables inside that. Within the container table at the bottom is a hidden radio button with the name "page1". I wrote an onClcick for the container table so the user can select the whole table instead of the radio button, but not I'm trying to change the style of the selected container so the users know they have selected it. I have tried a few different methods and I'm able to change the style to the new class by just writing document.getElementById('container').className = 'selected'; But because all 10 divs share the same name it will only change the style of the first element it finds. So I tried writing this loop to check if there are any selected radios in the document then to change the else name the style as the default. I'm sure its something stupid but I'm pretty stumped atm.. Any help would be appreciated. Thanks. selected = function () { var divs = document.getElementByTagName('DIV'), div, tbl, rad, stat, i; for (i = 0; i < divs.length; i++) { div = divs.id; if (div == 'dividend') { tbl = div.getElementById('container'); rad = tbl.getElementByTagName('INPUT'); if (rad.checked = true) { tbl.className = 'selected'; } } } };

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >