Search Results

Search found 1557 results on 63 pages for 'horizontal'.

Page 50/63 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • Display Consistent Value of an Item using MVVM and WPF

    - by Blake Blackwell
    In my list view control (or any other WPF control that will fit the situation), I would like to have one TextBlock that stays consistent for all items while another TextBlock that changes based on the value in the ObservableCollection. Here is how my code is currently laid out: XAML <ListView ItemsSource="{Binding Path=MyItems, Mode=TwoWay}"> <ListView.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock x:Name="StrVal" Text="{Binding StrVal}" /> <TextBlock x:Name="ConstVal" Text="{Binding MyVM.ConstVal}" /> </StackPanel> </DataTemplate> </ListView.ItemTemplate> </ListView> Model public class MyItem { public string StrVal { get; set; } } ViewModel public class MyVM { public MyVM() { ObservableCollection<MyItem> myItems = new ObservableCollection<MyItem>(); for (int i = 0 ; i < 10; i++) myItems.Add(new MyItem { StrVal = i.ToString()}); MyItems = myItems; ConstVal = "1"; } public string ConstVal { get; set; } public ObservableCollection<MyItem> MyItems { get; set; } } Code Behind this.DataContext = new MyVM(); The StrVal property repeats correctly in the ListView, but the ConstVal TextBlock does not show the ConstVal that is contained in the VM. I would guess that this is because the ItemsSource of the ListView is MyItems and I can't reference other variables outside of what is contained in the MyItems. My question is: How do I get ConstVal to show the value in the ViewModel for all listviewitems that will be controlled by the Observable Collection of MyItems.

    Read the article

  • jQuery toggle menu dropdown

    - by Seong Lee
    I am working on a menu navigation that has parent horizontal bar as static and a vertical accordion child menu that interacts with the parent. I have them working fine except one part where I want to toggle show() and hide() child menu when clicked on the same parent menu item. I've looked at toggle() jQuery API but couldn't get it working properly. The following is only a script for parent part which I got rid of toggle() for now. $(function () { $('#mainMenu > ul > li > a').click(function () { $('#mainMenu li').removeClass('active'); $(this).closest('li').addClass('active'); if ($(this).text() == "1st click") { $('#subMenu > ul').siblings().hide(); $('#subMenu > ul:nth-child(1)').show(); } else if ($(this).text() == "2nd click") { $('#subMenu > ul').siblings().hide(); $('#subMenu > ul:nth-child(2)').show(); } }); }); The Full code that isolates the problem is available here

    Read the article

  • overflow auto not working in IE

    - by Anthony Russo
    First off I have read a couple of q and a's on here about this issue but none of them seem to help. I have a couple other pages on the website that have no problems with resizing to height using overflow auto. The thing I have noticed is the pages work fine with one div. The page that is not working has two or more div and also I have tried it with a container but I still get the vertical and horizontal scroll bars. <div class="content"> <div class="container"> <div class="a"> <div class="left">List Items</div> <div class="right">List Items</div> </div> <div class="b"> This div is a FORM. </div> </div> </div> I could be making a simple error to you guys but I am new so bare with me!

    Read the article

  • Number of characters recommended for a statement

    - by liaK
    Hi, I have been using Qt 4.5 and so do C++. I have been told that it's a standard practice to maintain the length of each statement in the application to 80 characters. Even in Qt creator we can make a right border visible so that we can know whether we are crossing the 80 characters limit. But my question is, Is it really a standard being followed? Because in my application, I use indenting and all, so it's quite common that I cross the boundary. Other cases include, there might be a error statement which will be a bit explanatory one and which is in an inner block of code, so it too will cross the boundary. Usually my variable names look bit lengthier so as to make the names meaningful. When I call the functions of the variable names, again I will cross. Function names will not be in fewer characters either. I agree a horizontal scroll bar shows up and it's quite annoying to move back and forth. So, for function calls including multiple arguments, when the boundary is reached I will make the forth coming arguments in the new line. But besides that, for a single statement (for e.g a very long error message which is in double quotes " " or like longfun1()->longfun2()->...) if I use an \ and split into multiple lines, the readability becomes very poor. So is it a good practice to have those statement length restrictions? If this restriction in statement has to be followed? I don't think it depends on a specific language anyway. I added C++ and Qt tags since if it might. Any pointers regarding this are welcome.

    Read the article

  • Django ModelForm Imagefield Upload

    - by Wei Xu
    I am pretty new to Django and I met a problem in handling image upload using ModelForm. My model is as following: class Project(models.Model): name = models.CharField(max_length=100) description = models.CharField(max_length=2000) startDate = models.DateField(auto_now_add=True) photo = models.ImageField(upload_to="projectimg/", null=True, blank=True) And the modelform is as following: class AddProjectForm(ModelForm): class Meta: model = Project widgets = { 'description': Textarea(attrs={'cols': 80, 'rows': 50}), } fields = ['name', 'description', 'photo'] And the View function is: def addProject(request, template_name): if request.method == 'POST': addprojectform = AddProjectForm(request.POST,request.FILES) print addprojectform if addprojectform.is_valid(): newproject = addprojectform.save(commit=False) print newproject print request.FILES newproject.photo = request.FILES['photo'] newproject.save() print newproject.photo else: addprojectform = AddProjectForm() newProposalNum = projectProposal.objects.filter(solved=False).count() return render(request, template_name, {'addprojectform':addprojectform, 'newProposalNum':newProposalNum}) the template is: <form class="bs-example form-horizontal" method="post" action="">{% csrf_token %} <h2>Project Name</h2><br> {{ addprojectform.name }}<br> <h2>Project Description</h2> {{ addprojectform.description }}<br> <h2>Image Upload</h2><br> {{ addprojectform.photo }}<br> <input type="submit" class="btn btn-success" value="Add Project"> </form> Can anyone help me or could you give an example of image uploading? Thank you!

    Read the article

  • Java Swing rendering bug on Windows 7 look-and-feel?

    - by John B.
    The knob on vertical JSlider's on my Windows 7 machine (with native look-and-feel) is really, really tiny in both directions. Not just skinny but short as well. Can anyone confirm this? Should I report it? If so, where? Thanks! Here is the code for the sample program (in the screen shot): import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.SwingConstants; import javax.swing.UIManager; public class SliderTest { public static void main( String[] args ) { // Set the look and feel to that of the system try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() ); } catch ( Exception e ) { System.err.println( e ); } // Launch the GUI from the event dispatch thread javax.swing.SwingUtilities.invokeLater( new Runnable() { public void run () { JFrame window = new JFrame(); window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); JPanel contentPane = new JPanel(); contentPane.add( new JSlider(SwingConstants.HORIZONTAL) ); contentPane.add( new JSlider(SwingConstants.VERTICAL) ); window.setContentPane( contentPane ); window.pack(); window.setLocationRelativeTo( null ); // Center window window.setVisible( true ); } }); } }

    Read the article

  • How to get jQuery to find the first list-item, rather than all list-items?

    - by ricebowl
    I'm trying to implement a basic jQuery infinite carousel. As much for the learning process as for anything else (as a rule I'm not a fan of re-inventing wheels, but...I have to learn somehow, might as well start with the basics). I've managed to get the list to animate left happily enough, but I'm stuck when it comes to selecting the first element of the list. I've tried to use: $('ul#services > li:first'); $('ul#services > li:first-child'); $('ul#services > li').eq([0]); (xhtml below), In each case a console.log(first) (the var name used) returns all of the list-items. Am I doing something blatantly, and obviously, wrong? The eventual plan is to clone the first li, append it to the parent ul, remove the li from the list and allow the list to scroll infinitely. It's just a list of services rather than links so I'm not -at the moment- planning to have scroll or left/right functionality. Current xhtml: <div class="wrapper"> <ul id="services"> <!-- closing the `</li>` tags on the following line is to remove whitespace in the horizontal list, doesn't seem to make a difference to the jQuery from my own testing. --> <li>one</li ><li>two</li ><li>three</li ><li>four</li ><li>five</li ><li>six</li ><li>seven</li ><li>eight</li ><li>nine</li ><li>ten</li> </ul> </div>

    Read the article

  • ASP menu is not showing

    - by LauzPT
    My web application menu isn't showing in any browser I use to test. I looked around and checked out if it wasn't the z-index bug mentioned here, that seems to have caused some trouble to many people. I'm wondering if I'm doing something wrong: <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" /> </asp:Menu> I've got this as my SiteMap: <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode title="Pagina"> <siteMapNode url="Default.aspx" title="Home" description="Página Inicial" /> <siteMapNode url="Generos.aspx" title="Géneros" description="Géneros" /> <siteMapNode url="Artistas.aspx" title="Artistas" description="Artistas" /> <siteMapNode url="Musicas.aspx" title="Musicas" description="Músicas" /> <siteMapNode title="Admin" roles="Administrador"> <siteMapNode url="Admin/Musicas.aspx" title="Musicas"/> </siteMapNode> </siteMapNode> </siteMap> Any suggestions about what might be wrong? TIA

    Read the article

  • Porting Perl to C++ `print "\x{2501}" x 12;`

    - by jippie
    I am porting a program from Perl to C++ as a learning objective. I arrived at a routine that draws a table with commands like the following: Perl: print "\x{2501}" x 12; And it draws 12 times a '?' ("box drawings heavy horizontal"). Now I figured out part of the problem already: Perl: \x{}, \x00 Hexadecimal escape sequence; C++: \unnnn To print a single Unicode character: C++: printf( "\u250f\n" ); But does C++ have a smart equivalent for the 'x' operator or would it come down to a for loop? UPDATE Let me include the full source code I am trying to compile with the proposed solution. The compiler does throw an errors: g++ -Wall -Werror project.cpp -o project project.cpp: In function ‘int main(int, char**)’: project.cpp:38:3: error: ‘string’ is not a member of ‘std’ project.cpp:38:15: error: expected ‘;’ before ‘s’ project.cpp:39:3: error: ‘cout’ is not a member of ‘std’ project.cpp:39:16: error: ‘s’ was not declared in this scope #include <stdlib.h> #include <stdint.h> #include <stdio.h> #include <string.h> int main ( int argc, char *argv[] ) { if ( argc != 2 ) { fprintf( stderr , "usage: %s matrix\n", argv[0] ); exit( 2 ); } else { //std::string s(12, "\u250f" ); std::string s(12, "u" ); std::cout << s; } }

    Read the article

  • WPF binding comboboxes to parent- child model

    - by PaulB
    I've got a model with a few tiers in it - something along the lines of ... Company Employees Phone numbers So I've got a ListBox showing all the companys in the model. Each ListBoxItem then contains two comboboxes ... one for employees, one for phone numbers. I can successfully get the employee combo to bind correctly and show the right people, but I'd like the phone combo to show the numbers for the selected employee. I'm just setting the DataContext of the ListBox to the model above and using the following data template for each item <DataTemplate x:Key="CompanyBody"> <StackPanel Orientation="Horizontal"> <Label Content="{Binding Path=CompanyName}"></Label> <ComboBox Name="EmployeesCombo" ItemsSource="{Binding Path=Company.Employees}"></ComboBox> <!-- What goes here --> <ComboBox DataContext="???" ItemsSource="??" ></ComboBox> </StackPanel> </DataTemplate> I've tried (naively) <ComboBox ItemsSource="{Binding Path=Company.Employees.PhoneNumbers}" ></ComboBox> and <ComboBox DataContext="EmployeesCombo.SelectedValue" ItemsSource="{Binding Path=PhoneNumbers}" ></ComboBox> and all other manner of combinations ...

    Read the article

  • Set JTabbedPane width to constant

    - by msp
    I'm implementing an UI in Java Swing. Therefore I use a JTabbedPane. The tabbedPane has no components at startup. When i add a tab to the tabbedpane, the width of the tabbedpane increases, when i remove the tab, the width resizes to the width at the startup. This should not happen. The tabbedpane is placed on a JPanel which has a gridbag layout. Layout code: Container contentPane = mainFrame.getContentPane(); contentPane.setLayout( new GridBagLayout() ); GridBagConstraints c = new GridBagConstraints(); // add the component tree initComponentTree(); c.gridx = 0; c.gridy = 0; c.gridheight = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.LINE_START; c.weightx = 1; c.weighty = 1; contentPane.add( componentTree, c ); // add the tabbed pane initTabbedPane(); c.gridx = 1; c.weightx = 10; contentPane.add( tabbedPane, c ); // add the status panel initStatusPanel(); c.gridx = 0; c.gridy = 1; c.gridwidth = 2; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.LINE_START; c.weightx = 0; c.weighty = 0; contentPane.add( statusPanel, c ); Hope someone can help!

    Read the article

  • multiple screen support

    - by pedr0
    Hi at all, I have some problem with multiple screen support, I work with dp(dpi) for specify the layout_heigth and layout_width and I hope that is the better way to support multiple screen, but when I tried with two smartphone I meet two different result. I give an example, this is a layout I use: <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/cities_main_layout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@+id/citieslist" android:layout_width="wrap_content" android:layout_height="320dip" android:layout_gravity="center_vertical" android:layout_below="@id/cities_main_layout" /> <LinearLayout android:id="@+id/cities_button_layout" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/citieslist" android:layout_gravity="center_vertical"> <Button android:id="@+id/bycountry" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_bycountry" /> <Button android:id="@+id/top10" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_top10" /> <Button android:id="@+id/recommended" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_recommended" /> </LinearLayout> </RelativeLayout> The button are at the bottom of the layout, and I see two different result: In the last smartphone I can see the buttons, instead in the first I cannot...what's wrong? I have to write a layout for any set of screen??!!!

    Read the article

  • Have a clickable button on top of a combobox in WPF

    - by Travyguy9
    I can get a button to appear and be clickable in the drop down list of a combo box, but I cannot get the selected combo box item (the drop list is closed) to have the button be clickable. It always skips the button click and just opens the drop down list. I basically want the Button_Click event handler that I setup to be called once it is clicked. Here is my sample combo box that shows the button but is not clickable once it is in the selected item: <ComboBox x:Name="MyCombo" Width="200" Height="30" ItemsSource="{Binding ListCombo}"> <ComboBox.Resources> <DataTemplate DataType="{x:Type local:ComboItemClass}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=SampleText}" Width="120" /> <Button Width="20" Content="..." Click="Button_Click"/> </StackPanel> </DataTemplate> </ComboBox.Resources> </ComboBox>

    Read the article

  • csharp get value datatemplate element

    - by To-me
    Hello, Here is my code <ListBox x:Name="myList" IsSynchronizedWithCurrentItem="True" SelectionChanged="editElement"> <ListBox.ItemTemplate> <DataTemplate x:Name="ElementItemTemplate"> <StackPanel Name="stackPanelElementItem" Orientation="Horizontal"> <Label Name="SelectedItemlabel" Content="{Binding}" /> <Button Name="buttonDelElement" Click="btnDelElement">Delete</Button> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> private void btnDelElement(object sender, RoutedEventArgs e) { ListBoxItem lbi2 = (ListBoxItem)(lstCursus.ItemContainerGenerator.ContainerFromItem(myList.Items.CurrentItem)); String selectedItem = lbi2.Content.ToString(); MessageBox.Show("Selected Item " + selectedItem + " ."); private void editCursus(object sender, RoutedEventArgs e) { MessageBox.Show("Selected Item " + selectedItem + " ."); /* some code to edit selected item using linq */ } My issue, SelectionChange doesn't work anymore and when I click on buttonDelElement, Selected Item doesn't change immediately. Please, any ideas?

    Read the article

  • replacing elements horizontally and vertically in a 2D array

    - by wello horld
    the code below ask for the user's input for the 2D array size and prints out something like this: (say an 18x6 grid) .................. .................. .................. .................. .................. .................. code starts here: #include <stdio.h> #define MAX 10 int main() { char grid[MAX][MAX]; int i,j,row,col; printf("Please enter your grid size: "); scanf("%d %d", &row, &col); for (i = 0; i < row; i++) { for (j = 0; j < col; j++) { grid[i][j] = '.'; printf("%c ", grid[i][j]); } printf("\n"); } return 0; } I now ask the user for a string, then ask them where to put it for example: Please enter grid size: 18 6 Please enter word: Hello Please enter location: 0 0 Output: Hello............. .................. .................. .................. .................. .................. Please enter location: 3 4 Output: .................. .................. .................. ..Hello........... .................. .................. program just keeps going. Any thoughts on how to modify the code for this? PS: Vertical seems way hard, but I want to start on horizontal first to have something to work on.

    Read the article

  • Layout: how to make image to change its width and height proportionally?

    - by Exterminator13
    I have such layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/my_image" android:ellipsize="end" android:singleLine="true" android:text="Some text" android:textAppearance="?android:attr/textAppearanceMedium" /> <ImageView android:id="@+id/my_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/title" android:layout_alignBottom="@+id/title" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:adjustViewBounds="true" android:src="@drawable/my_bitmap_image" /> This layout does almost what I need: it makes image view height the same as text view. The image graphic contents stretched also keeping aspect ratio. But, the width of the image view does not change! As a result, I have a wide gap between text and the image view! As a temporal solution, I override View#onLayout. The question: how to change image width in xml layout? UPDATE: This is a final layout I need (text + a few images). Look at the first image: its width should be exactly the same as scaled image in it with no paddings and margins:

    Read the article

  • ListView exception for Images + Text

    - by drozzy
    I am trying to create a simple Icon+Text ListView but it does not work. I am using 2.1 Android SDK. My main class is very small slightly modified from the tutorial: public class Stuffs extends ListActivity { static final String[] COUNTRIES = new String[] {"A", "B","C"}; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.title, COUNTRIES)); } } and my list_item.xml file is this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation = "horizontal"> <ImageView android:id = "@+id/icon" android:src="@drawable/icon" /> <TextView android:id = "@+id/title" android:padding="10dp" android:textSize="16sp" > </TextView> </LinearLayout> I have also created a "drawable" directory in my res directory and copied a "icon.png" into it. But any time I try to run this the application hangs up unexpected in my android emulator. Am I missing something?

    Read the article

  • Need Help for Listview WPF events for finding index of rows and columns

    - by Ravi
    I have a listview in WPF and i displayed data in line by line manner,i want to just find the indexs of the rows and columns,i am new to WPF,plz give me some idea about this. <Grid Margin="3"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="600"></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" Grid.RowSpan="1"> <Label Name="lblID1" FontWeight="Bold" Grid.Row="0">ID:</Label> <Label Name="lblID" Grid.Row="0"> <TextBlock FontFamily="verdana" FontSize="12" FontWeight="Bold" Grid.Column="0" Padding="0" Text="{Binding Path=ID}"></TextBlock> </Label> <Label Name="lblDescrip1" FontWeight="Bold" Grid.Row="1">Description:</Label> <Label Name="lblDescrip"> <TextBlock FontFamily="verdana" FontSize="12" Grid.Column="1" Text="{Binding Path=DESCRIP}"></TextBlock> </Label> </StackPanel> Fee: Type: Special:

    Read the article

  • Tweaking rendering of thumbnail images in galleria

    - by saket
    I am working on the classic theme of Galleria to display a gallery. Here the requirement is to display the thumbnails in two row with the images in following order with a horizontal scroller if the thumbnails list div width increases more than 24. 1 3 5 7 9 11 13 15 17 19 21 23 .. 2 4 6 8 10 12 14 16 18 20 22 24 .. For if the images are less than 24 and more than 12 then the order should be rendered in two rows as :- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .. For if the images is less than 12 the images should be rendered in a single row as :- 1 2 3 4 5 6 7... Presently what I have done is I am using css3 column property to do this using different classes on the basis of image counts. This is working in all browsers but in IE8. So, is there any substitute for css3 column property for IE8 or less. Or some better way to implement the stuff that works fine in IE as well.

    Read the article

  • How to fetch the value of selected checkbox inside a checkboxList?

    - by Starx
    I want to know the selected value of the markup below. So that I can disabled a textbox, if one of the checkbox is selected. <asp:CheckBoxList ID="ChkTest" runat="server" RepeatDirection="Horizontal" CssClass="toggleYesNo"> <asp:ListItem Value="1">Yes</asp:ListItem> <asp:ListItem Value="0">No</asp:ListItem> </asp:CheckBoxList> I tried using this function it doesnot seem to work $(document).ready(function() { $("#<%=ChkTest.ClientID %>").click(function() { value = $(this).val(); if(value=='1') { $('#atextbox').attr('disabled',''); } else { $('#atextbox').attr('disabled','disabled'); } }); }); I also track the output HTML but the id the CheckBoxList the assigned to a table instead. UPDATED <table id="ChkTest" class="toggleYesNo" border="0"> <tr> <td><input id="ChkTest_0" type="checkbox" name="ChkTest$0" /><label for="ChkTest_0">Yes</label></td><td><input id="ChkTest_1" type="checkbox" name="ChkTest$1" /><label for="ChkTest_1">No</label></td> </tr> </table>

    Read the article

  • Web UI element to represent two different micro-views of data in the same spot?

    - by Chris McCall
    I've been tasked with laying out a portion of a screen for a customer care (call center) app that serves as sort of a header/summary block at the top of the screen. Here's what it looks like: The important part is in the red box. That little tooltip is the biz's vision for how to represent both the numeric SiteId and the textual Site Name all in the same piece of screen real estate. I asked, and the business thinks the Name is more important than the ID, but lists the Id by default, because the Name can't be truncated in the display, and there's only so much horizontal room to put the data. So they go with the Id, because it's fewer characters, and then they have the user mouse-over the Id to display the name (presumably because the tooltip can be of unlimited width and since it's floating over the rest of the screen, the full name will always be displayed. So, here's my question: Is there some better UI metaphor that I don't know about that could get this job done, while meeting the following constraints?: Does not require the mouse (uses a keyboard shortcut to do the "reveal") Allows the user to copy and paste the name Will not truncate the name Provides for the display of both the ID and name in the same spot Works with IE7

    Read the article

  • jQuery menu animation

    - by bomortensen
    Hi Stackoverflow, I'm building a website where I'm using jQuery to animate a horizontal tabbed menu. What I want to achieve can be seen here: / link removed / If you hover/mouseover the "Link 1" tab, you'll see that a white div is expanding. Each of the tab menu items are a styled li-tag. What I want to do is, that when you hover/mouseover i.e. the "Link 2" tab, the white div contracts and then expands again with content related to "Link 2" instead of "Link 1". Also, the "Link 1" tab should be expanded by default (i.e. when you just entered the site) Does any of you jQuery ninjas out there know how to do this? What I currently have is this: <script type="text/javascript"> $(document).ready(function(){ var $div = $('#divtest'); var height = $div.height(); $div.hide().css({ height : 0 }); $('#forside').hover(function () { if ($div.is(':visible')) { $div.animate({ height: 0 }, { duration: 200, complete: function () { $div.hide(); } }); } else { $div.show().animate({ height : height }, { duration: 200 }); } return false; }); }); </script> Do I need to have 4 different div's which expands/contracts for every mouseover? If i'm not being clear about what my problem is, please say so and I'll try to elaborate :) Thanks in advance!

    Read the article

  • html rending of a prtion of data

    - by pradeep
    Hi, I have a section like $myresult .= '<tbody>'; /*start printing the table wth feature and ratings */ for ($i = 1 ; $i < $numProperties; $i++){ if($master_rating_properties['rating'.$i.'_name']){ $myresult .= '<tr>'; $myresult .= '<td width=\'22%\'>'; $indfeature = 0; $indfeature = $row_product['property'.$i.'_avg']; $myresult .= $master_rating_properties['rating'.$i.'_name'].' ( '.$indfeature .')'; $myresult .= '</td>'; $myresult .= '<td colspan=\'0\' width=\'38%\' >'; $tocheck = $indfeature; for($k = 0.5; $k <= 10.0; $k+=0.5){ $tocheck = roundOff($tocheck); if(($tocheck) == $k) { $chk = "checked"; } else { $chk = ""; } $myresult .= '<input class=\'star {split:2}\' type=\'radio\' name=\'drating'.$i.'\' id=\'drating'.$i.''.$k.'\' value=\''. $k .'\' '.$chk.' title=\''. $k.' out of 10 \' disabled \'/>'; } /* for k loop end */ /* added later ,was missing */ $myresult .= '</td>'; $myresult .= '</tr>'; } /* end if loop */ } /* end i for loop */ $myresult .= '</tbody>'; /* end tbody */ it works fine like printing the 10 stars(radio buttons) horizontally . but many a time all the 10 stars turn vertical.and after few browser refreshes it comes back to horizontal position. any idea .y this is causing problem? does tbody tag cause some problem.

    Read the article

  • Code Golf: Connecting the dots

    - by ChristopheD
    Description: The input are multiple lines (terminated by a newline) which describe a 'field'. There are 'numbers' scattered across this field: the numbers always start at 1 they follow the ordering of the natural numbers: every 'next number' is incremented with 1 every number is surrounded by (at least) one whitespace on it's left and right Task: Draw lines between these numbers in their natural order (1 -> 2 -> 3 -> ...N) with the following characteristics: replace a number with a '+' character for horizontal lines: use '-' for vertical lines: use '|' going left and down or right and up: / going left and up or right and down: \ Important note: When drawing lines of type 4 and 5 you can assume that : (given points to connect with coordinates x1, y1 and x2, y2) distance(x1,x2) == distance(y1,y2). Have a look at the examples to see where you should 'attach' the lines. It is important to follow the order in which the dots are connected (newer lines can be drawn over older lines). Sample input 1 9 10 8 7 6 5 11 13 12 3 4 14 15 16 1 2 Sample output 1 /+ / | / | +/ +--+ | +\ | \ | \+ /+ | / | /+-------------+/ +---+ / | +--+ | + | +--------------------------+ Sample input 2 4 2 3 5 6 1 8 7 Sample output 2 /+ / | / | / | /+------------------+/ +--------+\ / \ +/ +--------------------------------------+ Winner: shortest solution (by code count). Input can be read via command line.

    Read the article

  • XNA, C# - Check if a Vector2 path crosses another Vector2 path.

    - by Nick
    Hello all, I have an XNA question for those with more experience in these matters than myself (maths). Background: I have a game that implements a boundary class, this simply hosts 2 Vector2 objects, a start and an end point. The current implementation crudely handles collision detection by assuming boundaries are always vertical or horizontal, i.e. if start.x and end.x are the same check I am not trying to pass x etc. Ideally what I would like to implement is a method that accepts two Vector2 parameters. The first being a current location, the second being a requested location (where I would like to move it to assuming no objections). The method would also accept a boundary object. What the method should then do is tell me if I am going to cross the boundry in this move. this could be a bool or ideally something representing how far I can actually move. This empty method might explain better than I can in words. /// <summary> /// Checks the move. /// </summary> /// <param name="current">The current.</param> /// <param name="requested">The requested.</param> /// <param name="boundry">The boundry.</param> /// <returns></returns> public bool CheckMove(Vector2 current, Vector2 requested, Boundry boundry) { //return a bool that indicated if the suggested move will cross the boundry. return true; }

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >